Skip to content

feat(services): deliver protected credential files to containers - #12619

Closed
sandl99 wants to merge 29 commits into
feat/12567-application-containersfrom
feat/12567-container-contract
Closed

sandl99 wants to merge 29 commits into
feat/12567-application-containersfrom
feat/12567-container-contract

Conversation

@sandl99

@sandl99 sandl99 commented Oct 5, 2026 •

Copy link
Copy Markdown
Collaborator

Outcome

Deliver generic private credential files before a container starts. Application connection settings, including VoiceClaw's gateway/workspace/sandbox/agent selection, are manually authored literal environment variables. Remove agentConnection, generated descriptors, and agent-reference handling from the SDK and protected provider.

PR 2 of the stack: v1 → #13093 → this PR. PR 1 remains open and unmerged. This PR still targets feat/12567-application-containers; its merge base is PR 1's 0590e8639573d712c8b4b73da6894817bd57ff0a, so the base changes are excluded from this review diff.

Reason

VoiceClaw-specific connection interpretation does not belong in a general container installer. The agreed contract keeps connection values manual for this phase while preserving private file delivery, explicit recovery, and owned cleanup.

Related issues

Refs #12569, #12567, #12570, #13131, and #12443.

Changes

  • secrets: {speech: {env: NVIDIA_API_KEY}} publishes /run/nemoclaw/secrets/speech; the application reads it through a read-only mount. Plain environment, command, and files remain nonsecret inputs.
  • One narrow protected_files resource owns the never-started publication container and its input volume. It resolves credentials before any mutation, verifies ownership, writes private files through Docker's archive API, and writes its public completion marker last.
  • Retain a stable resource ID before crossing the mutation boundary and record the physical helper_id separately. Failed uploads and volume-only partial state remain recoverable. Verify both objects before cleanup and confirm absence afterward. This eliminates the earlier OpenTofu adapter change.
  • Input preparation depends on the application's image acquisition, avoiding a cold-pull race. Publication replacement orders the application after its input resource; unrelated manual connection settings do not republish secrets.
  • Reject descriptor-era protected-provider state with schema version 1 rather than silently changing an established volume. Older YAML agentConnection is rejected rather than ignored. Keep its old bundle/state for cleanup; no migration is claimed.
  • Replace the connection fixture with one canonical credential/manual-environment fixture. Update the contract, provider reference, generated schema/reference, and usage docs.

The provider does not parse application authentication modes, issue tokens, refresh tokens, resolve agent references, or invoke agents. Linux host default ACLs remain outside the accepted fresh-volume/archive-delivery design. Rotating a value behind an unchanged reference is not detected; replacing only the app is not claimed to republish its separate input resource.

Verification

  • Tested commit: 8e8e28ef01d82a3383b6827a01872f49ff6375f8.
  • The failed-upload regression was reproduced on published 030ca9cfb4: it lost the partial binding. It passes after the repair. Provider tests cover missing credentials, private archive metadata, unchanged apply, interrupted upload, volume-only recovery, foreign helpers/volumes, and owned cleanup.
  • 819 focused SDK/provider/OpenTofu/Docker tests passed. Workspace Clippy and schema/reference checks passed.
  • Credential-isolated pinned Rust 1.98.1 cargo ci --full: formatting, Clippy and build passed; 1,496 of 1,498 ordinary tests passed. The same unchanged crates.io-dependent packaging test and host-specific Kubernetes timeout stop the full invocation; it is not reported as passing. The packaging case passed with offline cache use; the Kubernetes test passed under the default-profile SDK run. Earlier sandbox PTY failures passed after refreshing only inactive terminal denials; no test or timeout changed.
  • Separate cargo ci schema, cargo ci bundle, and cargo ci lifecycle passed, including all 146 selected lifecycle tests. Rust docs rendering and freshness checks passed. Hosted CI/Fern validation is pending for this commit.
  • All new commits read back GitHub Verified. Publication used an exact-prior-state, non-force guard and the installed pre-push hook inside credential isolation. No hook bypass or CI waiver.
  • The diff contains no secrets or API-key values.

Review notes

The accepted contract and VoiceClaw handoff are in docs/design/container-contract.md. The source was self-reviewed; no independent code approval or live qualification is claimed. Validation uses the recorded isolated Rust route in #12619 (comment). New canonical v1 validation/dependency inputs are not claimed byte-identical.

Keep draft. #12570 still owns actual Linux Docker delivery, HTTPS/OIDC and a post-apply VoiceClaw turn. VoiceClaw must implement the documented environment/file interface, then supply a revision, image digest, and authorized test environment. After a maintainer merges #13093, retarget this PR to v1 and revalidate the final diff. No images were published and no live resources deployed.


Signed-off-by: San Dang [email protected]

@copy-pr-bot

copy-pr-bot Bot commented Oct 5, 2026

Copy link
Copy Markdown

Auto-sync is disabled for draft pull requests in this repository. Workflows must be run manually.

Contributors can view more details about this message here.

@github-actions

github-actions Bot commented Oct 5, 2026

Copy link
Copy Markdown
Contributor

@sandl99

sandl99 commented Oct 6, 2026

Copy link
Copy Markdown
Collaborator Author

Updated draft publication decision and evidence

Decision: Accept publication of the protected-input and explicit unsupported-health installer candidate through the credential-isolated Rust v1 validation route. San Dang authorized updating the existing draft PR on October 6, 2026, after the differing current-v1 validation surface was disclosed: “In draft 12619, let's just keep to push, make sure you don't open it is ok”. The PR must remain draft; no new PR, ready-state change, merge, issue closure, image publication, or live deployment is authorized by this update.

Reason: make the current installer candidate available as a pullable branch for manual DGX Station testing. Placement: generic v1 SDK/container provider, the fixed Rust input helper, generated schema/reference, and scoped tests. Accountable NemoClaw maintainer: San Dang (sandl99); GitHub reported MAINTAIN permission before publication. VoiceClaw ownership and live integration acceptance are not inferred.

Publication repository/branch: NVIDIA/NemoClaw, feat/12567-container-contract, existing draft PR #12619 against v1. Expected prior branch and reviewed PR SHA: da61b4b7ee418d3c84f0404e3370786b827702f8. Signed local publication SHA: 0949d5faa437621e98751c1511f13fca7782385b, a proved descendant of that expected prior SHA. The old candidate completed all scheduled checks; paginated comments/reviews and complete review threads contained no actionable finding.

Canonical v1 comparison: 5a3f67fa25cc58d5484f8edf05fe0dc484dbb884. Canonical main template/policy comparison: 96288544410b87c0cf4bd968de710cf5449f0250. API and fetched refs matched before the final validation attempt. Cargo manifests/lockfile, source fingerprint inputs, and upstream validation helpers/configuration differ from current v1; no byte-identical validation claim is made. This recorded isolated route replaces that unavailable trusted-base execution requirement for this draft update only. GitHub CI, signing, DCO, independent review, and native Linux/Docker or VoiceClaw qualification are not waived.

Validation entry point: the repository's cargo ci alias, running locked Rust v1 build tooling without default features before pinned tool setup. The child environment is cleared; candidate processes cannot read contributor-home files or Keychain services, reach non-loopback networks or live engine sockets, or access active host terminals. Dependency caches and owned loopback fixtures are available. No real service credentials, model request, or deployed workload were supplied.

Exact final command:

/usr/bin/sandbox-exec -f .tools/publication.sb /usr/bin/env -i PATH=/Users/sdang/nvidia/NemoClaw/.worktrees/issue-12567-container-contract/.tools/rust-1.98.1/bin:/Library/Developer/CommandLineTools/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin CARGO_HOME=/Users/sdang/nvidia/NemoClaw/.worktrees/issue-12567-container-contract/.tools/cargo CARGO_NET_OFFLINE=true GIT_CONFIG_GLOBAL=/dev/null GIT_CONFIG_NOSYSTEM=1 XDG_CONFIG_HOME=/private/tmp/nemoclaw-v1-publication.RFqGNf PROTOC=/Users/sdang/nvidia/NemoClaw/.worktrees/issue-12567-container-contract/.tools/protoc-36.1/bin/protoc TMPDIR=/private/tmp/nemoclaw-v1-publication.RFqGNf LANG=en_US.UTF-8 SDKROOT=/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk CC=/Library/Developer/CommandLineTools/usr/bin/clang  cargo ci

Final run result: exit 0 in 266 seconds. Formatting, Clippy, build, 1,040 ordinary tests, four doctests, schema freshness, source-matched bundle assembly (0.1.0-dev.4946620d7951fc50), and all96 isolated lifecycle fixtures passed. Ordinary Nextest run: cc028356-0e79-42b1-a61f-1e640d972301; lifecycle run: 7018e11f-1373-43b6-a6ae-cf20cd649c49. The ordinary/lifecycle selections intentionally exclude opt-in live engine tests. The macOS toolchain emitted a nonfatal debug-strip warning about its unavailable LLVM library; compilation, bundle verification, and lifecycle validation still completed successfully.

Documentation rendering and freshness checks with --revision 0949d5faa437621e98751c1511f13fca7782385b passed in the same isolated environment. Bundled CLI help passed. Full logs are retained locally; no external Fern validation, Linux/Docker helper test, or real VoiceClaw turn is claimed.

Isolation profile SHA-256: ebf7594b65be85030f35294364d2637816aaf67e873ed811453d1c74103d5afe.

Resolved tool identities:

  • .tools/rust-1.98.1/bin/cargo: 6e17e865f3a20dd55a1d212f849f58b77124179f0de7c52973096d84ba34118d.
  • .tools/rust-1.98.1/bin/rustc: 766eda9d8f53afd6fc7f27b3cd2e444dd22afacb5afa710a5625fc8e45b8c941.
  • .tools/protoc-36.1/bin/protoc: dbd9a127dbbadd379bbea9a28a4349a0c9b1ad34b4c06f03fbe0f3853583a014.
  • .tools/nextest-0.9.144/cargo-nextest: af761c51ab5189b571309692450701e495beed7ae36e36be5aeec7e59a3e787f.

The first publication validation stopped before doctests/schema/bundle/lifecycle because four owned PTY allocations hit a stale local isolation denial. Full log and itemized source audit were retained. Read-only terminal enumeration plus a three-device owned probe demonstrated the cause; only the ignored profile was corrected. The probe, one credential cancellation test, and 17 progress tests then passed. Candidate code, assertions, eight-thread selection, and zero-retry policy were unchanged.

Publication uses a normal non-force Git push. An additional local pre-push guard checks exactly one advertised ref update, the expected prior SHA, declared repository/branch, local signed SHA, and fast-forward ancestry; it then executes the installed repository pre-push hook with identical input. Git's ref-update request uses that advertised old SHA as its atomic prior-state condition. Guard checks accepted the intended input and rejected mismatched old/candidate SHAs. No hook is skipped, and no persistent Git configuration is changed. Guard executable SHA-256: 6f896e90ae1bcf1ce6d04569507d4405fdf8e85592dcd6ec7cd6928b93de0e21.

After pushing, branch/PR SHA, GitHub verification, and draft state must be read back. Any unexpected or inconclusive result stops publication without retry. The PR remains a candidate; #12567-#12570 remain open until their complete acceptance evidence exists.

Resolve the current v1 conflict without rewriting published commits. Preserve strict health failure handling and the explicit unsupported-health installation exception.

Use gateway.runtime for container placement and network ownership. Migrate the complete protected-input fixture. The obsolete source failed compilation and the old fixture failed schema validation; all 32 focused contract/schema tests pass after migration. Regenerated schema bytes match, local docs render, and independent scoped documentation review found no blockers. Full cargo ci follows on this signed candidate.

Signed-off-by: San Dang <[email protected]>
@sandl99

sandl99 commented Oct 6, 2026

Copy link
Copy Markdown
Collaborator Author

Draft 12619 v1 compatibility update

Decision: Accept the already authorized draft-only publication through the recorded credential-isolated Rust v1 route. San Dang requested proceeding with the conflict repair, then clarified that the target is only installing VoiceClaw through NemoClaw v1. This update adds no installer architecture or operator. Placement and accountable maintainer remain those in the accepted publication record. No ready-state change, merge, issue closure, package/image publication, or live deployment is authorized by this publication.

Repository/branch: NVIDIA/NemoClaw, feat/12567-container-contract, existing open draft PR12619 against v1. Expected reviewed remote SHA: 0949d5f. Signed local candidate: 4e561e4, a merge with canonical v1 5a3f67f, retaining published ancestry. Current merge conflict justified this single base integration. Previous candidate checks were terminal; its completed paginated review collection contained no actionable finding. Native checks were absent because of the conflict.

Reason: upstream v1 moved compute selection to gateway.runtime. The container installer failed compilation at two obsolete sandbox.runtime references, and its complete YAML fixture failed schema validation at the old sandbox field. The fix uses the gateway's runtime for placement and network ownership, migrates the fixture, adds one regression covering Docker inheritance, Podman refusal without explicit placement, explicit Docker placement, and rejection of a sandbox override, and preserves the truthful unsupported-health paragraph during conflict resolution. Ollama/vLLM/registry/compiler siblings already use gateway.runtime after upstream integration. No lifecycle, authentication, custody, cleanup, or readiness relaxation was added.

Validation: full credential-isolated offline cargo ci on the signed clean candidate passed in347 seconds on macOS ARM64: formatting, Clippy, build, 1052 ordinary tests, four doctests, schema freshness, source-matched bundle 0.1.0-dev.6d7cf939f95c5960, and all96 lifecycle fixtures. Ordinary run d8f0add2-0896-4c95-9c5e-ae6264a80580; lifecycle run 14fc7473-088e-4aa1-a01a-a80e4a06aa27. Opt-in live Docker was excluded. A nonfatal missing-LLVM debug-strip warning did not prevent bundle validation. All32 focused contract/schema tests passed after the observed failures. Documentation rendering and docs --check at this exact SHA passed; bundled CLI help passed. Independent scoped documentation review found no factual or operational blocker; no merge approval or live qualification is claimed.

Canonical API and fetched refs matched immediately before final validation: v1 5a3f67f, main 9628854. Cargo manifests/lockfile, source fingerprint inputs and scoped tests differ from v1 for the accepted helper; validation execution is not claimed byte-identical. The existing maintainer-authorized isolated route applies to this draft update; GitHub CI, signing, DCO, review, and Linux/Docker/VoiceClaw qualification remain required.

Exact validation command:

/usr/bin/sandbox-exec -f .tools/publication.sb /usr/bin/env -i PATH=/Users/sdang/nvidia/NemoClaw/.worktrees/issue-12567-container-contract/.tools/rust-1.98.1/bin:/Library/Developer/CommandLineTools/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin CARGO_HOME=/Users/sdang/nvidia/NemoClaw/.worktrees/issue-12567-container-contract/.tools/cargo CARGO_NET_OFFLINE=true GIT_CONFIG_GLOBAL=/dev/null GIT_CONFIG_NOSYSTEM=1 XDG_CONFIG_HOME=/private/tmp/nemoclaw-v1-publication.RFqGNf PROTOC=/Users/sdang/nvidia/NemoClaw/.worktrees/issue-12567-container-contract/.tools/protoc-36.1/bin/protoc TMPDIR=/private/tmp/nemoclaw-v1-publication.RFqGNf LANG=en_US.UTF-8 SDKROOT=/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk CC=/Library/Developer/CommandLineTools/usr/bin/clang  cargo ci > .tools/v1-sync-ci-final.log 2>&1

The child environment is cleared. The isolation profile denies contributor-home files, Keychain services, active terminals, non-loopback network access and live engine sockets; it allows only task-owned files, dependency caches and loopback fixtures. Profile SHA256: ebf7594b65be85030f35294364d2637816aaf67e873ed811453d1c74103d5afe.

Resolved tool SHA256: cargo 6e17e865f3a20dd55a1d212f849f58b77124179f0de7c52973096d84ba34118d; rustc 766eda9d8f53afd6fc7f27b3cd2e444dd22afacb5afa710a5625fc8e45b8c941; protoc dbd9a127dbbadd379bbea9a28a4349a0c9b1ad34b4c06f03fbe0f3853583a014; nextest af761c51ab5189b571309692450701e495beed7ae36e36be5aeec7e59a3e787f.

Publication uses one normal non-force push with the exact advertised prior-SHA guard, ancestry proof, exact candidate/repository/branch checks and the installed normal pre-push hook. The intended input passed; wrong prior/candidate SHAs were rejected. Guard SHA256: 677758d6955c23501639597cf2c04f25fb4b2271bfd1fd5d39ff2ed59877de47. Branch/PR readback and GitHub verification are required afterward; any unknown result stops without retry.

@wscurran wscurran added area: architecture Architecture, design debt, major refactors, or maintainability area: security Security controls, permissions, secrets, or hardening platform: container Affects Docker, containerd, Podman, or images platform: linux Affects non-Ubuntu Linux environments labels Oct 6, 2026
@sandl99

sandl99 commented Oct 7, 2026

Copy link
Copy Markdown
Collaborator Author

Local HTTP development profile: draft publication evidence

Decision: Accept continuing the existing draft-only publication through the recorded credential-isolated Rust v1 route. San Dang authorized implementation of the local HTTP/no-client-auth option and then continuation on October 7, 2026 (“Ok next”). Reason: make the current installer available for manual DGX Station testing without an external HTTPS gateway or issuer. Placement: existing generic container connection SDK/provider, schema/reference and tests; no application-specific operator. Accountable maintainer: San Dang (sandl99), authenticated GitHub permission MAINTAIN observed before publication. The accepted product scope is recorded in docs/design/scope.md; scope approval and the isolated publication decision remain the draft route. No new PR, ready-state change, merge, issue closure, image/package publication or live deployment is authorized.

Immutable publication inputs: NVIDIA/NemoClaw, branch feat/12567-container-contract, existing OPEN DRAFT PR #12619 against v1, reviewed/expected remote SHA 4e561e4a16665919f45f37e5e19e8ec039b139c5. Signed local candidate e1494f9727a329a244839c7183a26ed6c384a75b contains implementation 959ad0be1855acce2728099c48c676a2a87c169c and one permitted merge of canonical v1 to resolve its current conflict. Expected prior SHA is an ancestor of the candidate. Canonical v1 API and fetched ref: 99d4d98d840729e489c70cf9ed4de78e05a9708d; canonical main template/policy API and fetched ref: 2306bc5f49c7a2f2697e9dfc781b5f4d21dc3580. Main and v1 do not share ancestry; source diff uses canonical v1 and publication template/sensitive policy use canonical main. No byte-identical validation claim is made for the Rust v1 surface. GitHub CI, signed commits, DCO, independent review and live qualification are not waived.

The reviewed prior remote candidate completed evaluation: Linux ARM64/AMD64, macOS ARM64, documentation and dependency checks passed. Windows Clippy failed on the test-only secret helper's unused function; the exact Unix-only callers are now matched by cfg(all(test, unix)). Both image jobs failed fetching the pinned shared Fabric source before helper compilation. This is dependency-download failure evidence, not a proved base reproduction or a waiver of image qualification. Paginated comments, reviews, inline comments and complete review threads contained no actionable finding; no Advisor/CodeRabbit review was scheduled. Independent read-only review of the exact local merged candidate and publication text found no source/security blockers. No merge approval is inferred.

Validation runs locked native tooling in a cleared-environment, offline sandbox. Candidate code cannot read contributor-home credentials or Keychain, reach non-loopback networks/live engines, or access inventoried active user terminals. Caches and owned loopback fixtures are allowed. Resolved validator entry point is the checked-in Rust cargo ci alias; the differing surface is disclosed under the existing maintainer isolation route.

Exact full validation command (repository root):

/usr/bin/sandbox-exec -f .tools/publication.sb /usr/bin/env -i PATH="$PWD/.tools/rust-1.98.1/bin:$PWD/.tools/nextest-0.9.144:/Library/Developer/CommandLineTools/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin" CARGO_HOME="$PWD/.tools/cargo" CARGO_NET_OFFLINE=true GIT_CONFIG_GLOBAL=/dev/null GIT_CONFIG_NOSYSTEM=1 XDG_CONFIG_HOME=/private/tmp/nemoclaw-v1-publication.RFqGNf PROTOC="$PWD/.tools/protoc-36.1/bin/protoc" TMPDIR=/private/tmp/nemoclaw-v1-publication.RFqGNf LANG=en_US.UTF-8 SDKROOT=/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk CC=/Library/Developer/CommandLineTools/usr/bin/clang cargo ci

Final result: exit 0; all selected CI steps passed in 506 seconds. Formatting, Clippy, build, 1,248 ordinary tests, four doctests, schema freshness, source-matched bundle assembly (0.1.0-dev.b113d0e8e1ecfd04) and all 101 isolated lifecycle tests passed. Ordinary Nextest run 812e0fd6-67c4-4a11-bc12-29f9416d2a0b; lifecycle run 85aa1b37-7e8f-4b67-bd8b-28c472e900d7. Seven lifecycle tests exceeded the slow threshold but all passed. The macOS debug-strip helper emitted a nonfatal unavailable-LLVM warning; bundle verification and lifecycle checks passed. Documentation rendering and freshness (cargo run --locked --offline -p nemoclaw-build -- docs --check --revision e1494f9727a329a244839c7183a26ed6c384a75b), bundled CLI help and diff whitespace checks passed under the same isolation. Source is clean and unchanged. No opt-in live engine suite ran.

The first final-candidate attempt stopped at six owned PTY allocations with EPERM, before behavioral assertions. An owned three-terminal probe reproduced the stale profile deny entries; removing only inactive-slot denials restored the same owned allocations while preserving every inventoried active terminal and all credential/network restrictions. An itemized source/predicate/downstream audit was completed before rerun. The corrected profile passed 17 progress tests, one credential-cancellation test and one CLI terminal-output test covering eleven authored scenarios. No tracked code, assertion, timeout, thread count, test selection or retry-policy changes. The failed aggregate is retained and not reported as success.

Resolved tool SHA-256 identities:

  • Cargo: 6e17e865f3a20dd55a1d212f849f58b77124179f0de7c52973096d84ba34118d.
  • rustc: 766eda9d8f53afd6fc7f27b3cd2e444dd22afacb5afa710a5625fc8e45b8c941.
  • protoc: dbd9a127dbbadd379bbea9a28a4349a0c9b1ad34b4c06f03fbe0f3853583a014.
  • Nextest: af761c51ab5189b571309692450701e495beed7ae36e36be5aeec7e59a3e787f.
  • Corrected isolation profile: 2910e1005f0c6199eb4a176abbfadf484ac42af43706b06775c05c03183d8ebb.
  • Atomic-prior-state guard executable: 13b92526fb84c6c62765a0b91921e829b7bc7b77074bffa7c1e67e3a9101d3ad.
  • Installed normal pre-push hook: d000b4890d11bb62087c0eefea0586a5a9329a95c8d1f63895bed3c696713512.

Publication uses one normal non-force push of the exact candidate, with an additional guard that checks the advertised old SHA, exact branch/repository, local HEAD, one-ref update and fast-forward ancestry, then delegates the installed normal hook unchanged. The Git ref-update request uses that advertised old SHA atomically. Guard positive input passed the normal hook; mismatched prior/candidate inputs were rejected before hook execution. No hook bypass or persistent Git configuration change. Immediately before publication, both branch and PR must still equal the reviewed prior SHA; after publication, both must equal the candidate with unchanged PR identity/base and draft state. Unexpected or inconclusive readback stops without an automatic retry. Every published commit must read back GitHub Verified.

VoiceClaw's published matching branch sandl99/nemotron-voice-agent:feat/voiceclaw-container-v1 remains at d90f5e92af307e17d7c64541931c9ef6c7c1f76f. Its private IPv4 HTTP/no-auth descriptor and SDK transport match this candidate. Speech credentials remain required/protected. Plain HTTP has no encryption or client/per-application authorization; this explicit mode is for trusted local development, not production/shared untrusted workloads. There is no automatic downgrade.

Native agent health remains unsupported and requires the explicit installation exception. VoiceClaw image startup/frontend/readiness, real Docker/Linux protected-input qualification, model generation and joint live voice turns remain unrun. No real secrets were added. Current-commit GitHub evaluation must be collected after publication; draft-only publication is not integration qualification.

cv pushed a commit that referenced this pull request Oct 7, 2026
…2773)

## Summary

Plan validation now accepts only the observations a compiled graph
reads. Compilation supplies those addresses, so `plan.rs` no longer
rebuilds them from name prefixes.

Fixes #12534.

## Failure

`observation()` in `deployment/plan.rs` rebuilt allowed observation
names from prefixes that sandbox, runtime, and Docker compilation also
encode. Across the 44 examples, those rules accepted observations no
compiled graph reads:

- any numbered discovery address, such as
`data.nemoclaw_fabric_capabilities.sandbox_99`;
- `data.nemoclaw_engine_capabilities.current` and the gateway capability
observations, when the graph does not read them;
- runtime image checks for a container the graph does not check, such as
`managed_gateway_runtime`.

Its capacity rule matched `data.nemoclaw_service_capacity`, which SDK
graphs stopped emitting in `bd5f8df94`; it accepted nothing on any
example graph.

## Changes

- `compile::observations` returns the data sources a compiled graph
reads. Apply, the runtime stage, and teardown add them to the addresses
the plan gate expects. Teardown keeps the applied graph's observations
before it removes the `data` block.
- `observation()` accepts a data source only when it is expected. Its
action, duplicate, deposed, and mode rules are unchanged.
- Remove the prefix rules, `compile::is_gateway_observation`,
`discovery_graph::is_observation`, and `services::capacity`, which only
the gate used.
- The gateway observation test now declares the observation it checks,
because declaration is what the gate checks.

A new service kind, such as the containers in #12619, needs no change in
`plan.rs`.

## Evidence

- New tests compile the deployment and runtime graphs of every example
(63 graphs). Every observation a graph reads passes, and undeclared
observations are rejected on apply and on teardown. Against the gate on
`72d12f7`, both rejection tests fail with `sandbox_99` accepted.
- A new test keeps deposed observations and unsupported resource modes
rejected; it passes before and after.
- Linux ARM64: `cargo ci` passes (1251 tests, 101 lifecycle tests), and
`cargo ci live-docker` passes all 10 Docker live tests.
- macOS ARM64: `cargo fmt --check`, Clippy with `-D warnings`, and the
SDK unit tests pass.

## Notes

- With OpenTofu 1.12.6, destroy plans for the teardown graph list no
data sources, because `compile_teardown` removes the `data` block.
Teardown still passes the applied graph's observations, so the gate
keeps accepting their discard as
`gateway_observations_are_read_only_in_plans_and_discardable_during_teardown`
expects.

## Not in this PR

`deployment/reporting.rs` and `deployment/apply.rs` still derive some
observation names for reporting and readiness. They do not decide plan
acceptance.

---
Signed-off-by: Bowen Zhu <[email protected]>

Signed-off-by: Bowen Zhu <[email protected]>
Merge v1 7509f87 while preserving published ancestry. Register protected-input observations through provider-owned definitions, compile typed storage and OpenShell sandbox bindings, and preserve partial-input ownership checks in the generic resource adapter.

Signed-off-by: San Dang <[email protected]>
@sandl99 sandl99 changed the title feat(services): add shared application container lifecycle feat(services): share Docker installation for containers and inference Oct 12, 2026
@cv cv added the v1 NemoClaw v1 branch label Oct 12, 2026
@sandl99
sandl99 changed the base branch from v1 to feat/12567-application-containers October 13, 2026 13:38
@sandl99 sandl99 changed the title feat(services): share Docker installation for containers and inference feat(services): deliver protected inputs and agent connections Oct 13, 2026
…yped provider

Merge the updated application-container branch (884ba68), which
brings canonical v1 7c77512 after the provider reorganization in
#13131.

The nemoclaw provider no longer exists, and v1 requires resources to
take HCL inputs rather than SDK-compiled documents. Protected input
delivery therefore moves to its own narrow owner:

- New `protected` provider, built from nemoclaw-provider, with one
  `protected_files` resource. It takes typed engine, volume, ownership,
  setup image, user and root inputs, a `credentials` map of environment
  references and paths, an optional `connection` block, and the selected
  `fabric_agent`'s ref instead of a serialized spec and sandbox_id.
- The SDK owns the declarations, validation, and descriptor projection
  (`inputs::Files`). Connection profile rules are shared by the YAML
  validator and the resource. The managed-gateway binding stays in the
  SDK; the resource enforces the explicit profile.
- The completion revision covers only inputs that determine the
  published files, so replacing the setup image republishes the same
  files.
- The setup image gate uses host_image with the publisher contract
  label. The resource still checks the full image contract itself.
- Applications wait for data.fabric_agent_readiness of their agent.
- Typed inputs remove the special `spec` binding path in deployment
  state validation; protected_files bindings are disposable.

Admission before transfer, foreign-ownership refusal, interrupted
delivery recovery, stopped-helper deletion, and filesystem checks are
unchanged.

Signed-off-by: San Dang <[email protected]>
…t_connection

OpenTofu reserves `connection` in resource blocks for provisioners, so it never reached the provider: an authored protected_files resource with a connection failed validation. The pinned OpenTofu contract test found it. The block is now `agent_connection`, matching agentConnections in YAML.

Signed-off-by: San Dang <[email protected]>
…sher build

Signed-off-by: San Dang <[email protected]>

#13087 moved examples/onboarding-tui under crates/ and removed the same copy from the Ollama proxy image. The publisher image still copied it, so the hosted Agent images build failed before compiling.
…ed files

OpenTofu loads every declared provider's schema on each command. Declaring the protected provider in every graph slowed hosted Linux lifecycle tests by 5-10% and pushed remote_model_reapply_and_drift_keep_bindings_and_stop_on_observation_failure past its 90 s budget. Graphs now declare it only when they contain protected_files, like the Docker provider. A state-only protected_files resource still plans its removal through the provider address recorded in state.

Signed-off-by: San Dang <[email protected]>
Merge the trimmed application-container branch (62b8d37) and replace
the protected-input implementation with a smaller one. Product behavior
is unchanged: credential references and an agent connection reach the
application as private files before it starts, and credential values
never enter its environment, configuration, plans, or state.

- Delivery: the protected_files resource creates a fresh volume and a
  setup container from the application image that never starts, writes
  the files with Docker's archive API (0600 files, 0700 directories,
  owned by the application user), and writes a completion marker last.
  The application mounts the volume read-only at /run/nemoclaw.
- Removed: the Rust publisher crate and its image, the stdin protocol,
  inputSetup, Docker archive metadata reads, OpenTofu repair IDs,
  revision-based data volume names, installer image checks and
  replacement-trigger plumbing, the credential preflight, and duplicate
  validation.
- YAML: secrets maps a file name to a credential reference.
  agentConnection names sandboxRef, an optional gatewayEndpoint, and
  authentication mode and secretRef. The agent, TLS trust, refresh
  mode, timeouts, and paths are derived.
- Tests: one provider behavior test covers credential checks before any
  change, private files, unchanged apply, interrupted publication,
  foreign resources, and owned cleanup; one compile test and one
  rejection test cover the SDK.

The in-volume ACL check is dropped: every publication uses a fresh
volume that the application only mounts read-only.

Signed-off-by: San Dang <[email protected]>
…ference MDX-safe

Hosted CI on f3a741b failed twice. Windows Clippy rejected FilesBackend::with_secrets as unused, because the provider tests that call it run only on Unix. The Fern check rejected the generated configuration reference, which rendered /run/nemoclaw/secrets/<name> from a field description as an MDX tag; the path is now code formatted.

Signed-off-by: San Dang <[email protected]>
…ion-owned

Merge the container base. Remove agentConnection, generated descriptors, agent refs, and connection-profile validation from protected_files. Manual VoiceClaw settings are ordinary environment strings. Input preparation waits for image acquisition.

Retain stable resource identity before creation/upload and track the physical helper separately, so interrupted writes and volume-only partial state remain recoverable. Check helper and volume ownership before cleanup and confirm absence. Reject descriptor-era state with schema version 1. This removes the generic OpenTofu computed-ID change. The failed-upload regression fails on published 030ca9c and passes here. 819 focused SDK/provider/OpenTofu/Docker tests, Clippy, schema and documentation checks pass in the credential-isolated sandbox; full pinned CI follows.

Signed-off-by: San Dang <[email protected]>
@sandl99 sandl99 changed the title feat(services): deliver protected inputs and agent connections feat(services): deliver protected credential files to containers Oct 16, 2026
@sandl99

sandl99 commented Oct 16, 2026

Copy link
Copy Markdown
Collaborator Author

Closing at the maintainer’s request. Protected credential-file delivery is deferred; PR #13093 will stand alone with literal container environment settings and explicit plaintext-exposure warnings. This PR’s branch and commit history are preserved. No protected-file support or live qualification is claimed.

@sandl99 sandl99 closed this Oct 16, 2026
sandl99 added a commit that referenced this pull request Oct 16, 2026
…nputs

Merge current v1 to repair the compile_teardown API mismatch seen in CI. Update the new fixtures to the pinned gateway image. Keep PR #13093 independent of the closed protected-input PR #12619.

Record the maintainer-approved temporary literal environment approach, including plaintext configuration/state/Docker exposure and no automatic redaction. Preserve typed managed-model credential storage and memory safeguards. No protected-files resource is added. 795 focused SDK/provider/runtime tests, workspace Clippy, generated schema/reference, and Rust documentation checks pass in credential isolation; full CI follows.

Signed-off-by: San Dang <[email protected]>
cv pushed a commit that referenced this pull request Oct 16, 2026
#13093)

## Outcome

Share one Docker container assembly across generic application
containers and managed Ollama/vLLM services. Keep the typed model
installers' hardware checks, memory safeguards, readiness, retained
storage, authentication, and update policies.

## Reason

An application image should not need a custom SDK installer to supply
its arguments, configuration, resource limits, or readiness check.
Ollama and vLLM already run as containers and can use the same assembly
layer.

### Related issues

Fixes #12567, #12568, #12570, and #13131. Protected credential-file
delivery from #12569/#12619 remains deferred.

## Changes

- Add `kind: container` with image-owned arguments, literal environment
values, nonsecret files, resource limits, a listener port, private
publication, and HTTP, managed-status, or Docker health checks.
- Reuse the common container base from the Ollama/vLLM installers. Their
model configuration and safeguards remain with those installers.
- Allow a ready, privately published OpenAI-compatible container to
serve an inference `serviceRef`.
- Bind readiness to the physical container identity and preserve literal
application arguments/configuration while rewriting resource
dependencies.
- Recognize `container_service` in retained generation validation. A
focused inline regression covers state save, reopen, and removal of a
service whose generation remains retained.
- Remove the explicit managed-model comparison test and all three YAML
fixtures added by this PR. Existing service-reference and container
behavior tests remain.
- Document the generic container contract. Literal credentials can enter
configuration, plans, state, exports, and Docker inspection; generic
protected-file delivery remains outside this PR.

## Verification

Commit under review: `6cb70c8319fdfb59d1d423f292b2311dc435edd8`.

- The new state regression failed before the one-line allowlist repair
with `deployment intent record is invalid`.
- Credential-isolated `cargo ci --full`: **passed** on macOS ARM64,
including formatting, workspace Clippy, build, **1,484 unit tests**,
doctests, schema, bundle, and **147 lifecycle tests**. The run kept the
repository profiles, assertions, and timeouts.
- Rust documentation rendering, source/link checks, and generated-page
freshness: **passed** for this commit.
- Hosted [Rust
desired-state](https://github.com/NVIDIA/NemoClaw/actions/runs/38936140592),
[agent image
checks](https://github.com/NVIDIA/NemoClaw/actions/runs/38936140672),
[dependency
policy](https://github.com/NVIDIA/NemoClaw/actions/runs/38936140534),
and [documentation
validation/preview](https://github.com/NVIDIA/NemoClaw/actions/runs/38936140625):
**passed**. Platform build/test and lifecycle jobs passed on Linux
AMD64/ARM64, macOS ARM64, and Windows AMD64; Linux Docker/Kind suites
also passed.
- [Manual integration
evidence](#13093 (comment)):
a fresh VoiceClaw browser session reached OpenClaw through Fabric, used
local `Qwen/Qwen3-4B`, and displayed the binary-search answer. That run
used `bf93570` plus the production allowlist repair now included here;
it did not run this final commit.
- The diff contains no secrets, API keys, or credentials. Validation
runs in a cleared, credential-isolated environment; an outside-worktree
canary read was denied. Publication preserves the installed hook and
rejects a changed prior branch SHA.

## Review notes

Self-review covers the shared assembly, typed installers, container
readiness, state persistence, and plaintext-environment boundary.
Independent maintainer review is outstanding. The PR is ready for human
review.

The manual test establishes backend execution and display. The backend
supplied speech text, but the operator heard no spoken result; result
audio delivery/playback remains unqualified in companion [VoiceClaw
#162](NVIDIA-AI-Blueprints/nemotron-voice-agent#162).

Pinned Fabric reports `fabric_health_unsupported` while its native
runtime is running, so the VM's setup applies exited 1. Retained-state
recreation also failed during gateway observation; setup used a fresh
UID and state. Those lifecycle paths are unchanged from the recorded v1
base. Neither observation is reported as a successful readiness or
recreation test.

---

Signed-off-by: San Dang <[email protected]>

---------

Signed-off-by: San Dang <[email protected]>
@cv
cv deleted the feat/12567-container-contract branch November 21, 2026 20:44
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: security Security controls, permissions, secrets, or hardening platform: container Affects Docker, containerd, Podman, or images platform: linux Affects non-Ubuntu Linux environments v1 NemoClaw v1 branch

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants