Skip to content

test(e2e): keep only NemoClaw's retention promise in the Kubernetes destroy checks - #13422

Merged
cv merged 1 commit into
v1from
test/kubernetes-retention-only
Oct 18, 2026
Merged

cv merged 1 commit into
v1from
test/kubernetes-retention-only

Conversation

@cv

@cv cv commented Oct 18, 2026

Copy link
Copy Markdown
Collaborator

Part of #12731. Follows #13421, which merged before this narrowing reached it.

Failure

#13421 added three live Kind checks, two of which test other components:

  • The gateway refusing an expired development token: token verification is OpenShell's.
  • The Helm release record and StatefulSet disappearing after SDK destroy: that's Helm's and Kubernetes' behavior.

NemoClaw's part, classifying an authentication failure and having its graph destroy the release, already has unit and plan-level coverage.

Decision

Validation

This commit was tested on #13421's branch, whose code matches the merged #13421:

  • cargo ci passes locally: 1,589 unit tests and 153 lifecycle tests.
  • cargo ci live-kind passes locally: all 7 tests.

The gateway refusing an expired token is OpenShell's behavior, and the
Helm release and StatefulSet disappearing after destroy is Helm's and
Kubernetes'. NemoClaw's part, keeping the namespace, encryption key and
gateway claims across destroy, stays.
@cv
cv enabled auto-merge (squash) October 18, 2026 15:03
@cv
cv merged commit a90ac73 into v1 Oct 18, 2026
@cv
cv deleted the test/kubernetes-retention-only branch October 18, 2026 15:15
@github-actions

Copy link
Copy Markdown
Contributor

@wscurran wscurran added area: e2e End-to-end tests, nightly failures, or validation infrastructure area: security Security controls, permissions, secrets, or hardening chore Build, CI, dependency, or tooling maintenance platform: k8s Affects Kubernetes deployments labels Oct 23, 2026
cv added a commit that referenced this pull request Oct 26, 2026
…en is refused (#13632)

Part of #12734. It builds on #13551, now merged.

## Failure

The Kind OIDC test used one token for apply, export and destroy, so no
live run showed that NemoClaw reads `token.env` again on each command,
the renewal docs/kubernetes.md documents ("When the token expires, get a
new one and rerun"). The refused plan was checked only for not echoing
the token: nothing showed that a refusal leaves state alone or that no
token reaches the state directory. The issuer's namespace was deleted
only after every check passed.

## Decision

```mermaid
flowchart LR
    K["issuer key<br/>nc-issuer-* namespace"] -->|first token| A["Deployment 1<br/>apply"]
    K -->|other audience| R["Deployment 2<br/>plan: refused"]
    K -->|rotated token, 1 s later| P["Deployment 3<br/>plan: no changes<br/>export = document<br/>destroy"]
    A --> R --> P --> S["no token in any<br/>state file"]
    R -.- U["intent.json, tfstate, kubernetes/<br/>byte-identical; no token in error"]
```

- Refusal: `intent.json`, `terraform.tfstate`, its backup and every file
under `kubernetes/` must be byte-identical before and after the
foreign-audience plan, with none added or removed, and the error text
must hold no token. The refusal surfaces as an OpenTofu execution error,
so its wording and class are not checked. Generated configuration, the
lock file, saved plans, `.terraform`, `.helm` and `diagnostics/` are
left out, because each command writes them.
- Rotation: the test signs a second token with the issuer's key one
second later, so `iat`, `nbf` and `exp` differ. Only a new Deployment
holds it, and it runs plan, export and destroy.
- Secrets: after export and after destroy, no regular file in the state
directory may contain any of the three tokens. The raw-byte search skips
OpenTofu's symbolic links to the bundle and cannot see inside saved
plans, which are zip archives.
- Cleanup: every assertion runs after destroy. If destroy with the
rotated token fails, a separate Deployment with the first token destroys
before the test fails. A drop guard deletes the issuer namespace when
the test passes or panics, bounded at 15 s; a nextest time-limit kill
skips it.
- No red test:
`a_refused_forward_token_is_an_authentication_failure_without_effects`
and `failed_and_partial_observations_retain_protocol_state` cover these
promises against fakes, and no defect is known. A token in state, or
state changed by a refusal, would be a defect to reproduce at the unit
or contract layer first.
- Out of scope: expiry enforcement, which #13422 left to OpenShell.
- docs/contributing/live-tests.md describes these checks and their
limits, and names the token field `token.env` instead of the rejected
`tokenEnv`.

## Validation

- After merging v1 `62f994bf8`, which holds #13551 and switches the live
agent to OpenClaw (#13704), `cargo ci` passed: 156 lifecycle tests.
- The real `cargo ci live-kind` with OpenClaw on linux_arm64 passed 7 of
7, including this OIDC test, at 102.6 s. This host runs Kind about 1.5
times slower than a CI runner.
- Earlier, on local k3s with Pi, it passed twice at 81.7–85.1 s, about 4
s more than before this change.
- Giving the rotated Deployment the other-audience token failed the
test, as intended: its operations failed with `observation
authentication failed`, which holds no token, and the fallback destroy
with the first token succeeded.
- Temporary offline tests, not committed, checked the state snapshot,
the token search and the guard. Against a server that accepts
connections and never answers, the guard returned after 15 s, and after
30 s without the bound.

---------

Signed-off-by: Carlos Villela <[email protected]>
Co-authored-by: Claude Opus 5.5 <[email protected]>
Co-authored-by: Carlos Villela <[email protected]>
@wscurran wscurran added the v1 NemoClaw v1 branch label 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: e2e End-to-end tests, nightly failures, or validation infrastructure area: security Security controls, permissions, secrets, or hardening chore Build, CI, dependency, or tooling maintenance platform: k8s Affects Kubernetes deployments v1 NemoClaw v1 branch

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants