Skip to content

fix(policy): accept Hermes GPU baseline enrichment - #10123

Merged
cv merged 3 commits into
mainfrom
fix/hermes-portable-policy-enrichment
Aug 24, 2026
Merged

cv merged 3 commits into
mainfrom
fix/hermes-portable-policy-enrichment

Conversation

@senthilr-nv

@senthilr-nv senthilr-nv commented Aug 24, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

Hermes Portable previously rejected the live policy after OpenShell added its documented native-GPU filesystem baseline. This change accepts only that bounded enrichment while preserving strict rejection of unrelated policy drift.

Related Issue

Fixes #10121

Changes

  • Recognize the OpenShell v0.0.106 native-GPU baseline as a semantic enrichment of the exact create policy.
  • Require the direct-GPU authority signal, preserve every intended path, allow only documented GPU paths, and keep scoped base/full policy equality mandatory.
  • Continue recording distinct intended and verified-live semantic digests for receipt and lifecycle revalidation.
  • Add deterministic acceptance and fail-closed drift regressions, including arbitrary paths, removed paths, non-filesystem changes, near matches, duplicates, missing /proc promotion, and ordinary-policy misuse.
  • No documentation change is required because CLI syntax, output, and supported configuration are unchanged.

Type of Change

  • Code change (feature, bug fix, or refactor)
  • Code change with doc updates
  • Doc only (prose changes, no code sample modifications)
  • Doc only (includes code sample changes)

Quality Gates

  • Tests added or updated for changed behavior
  • Existing tests cover changed behavior — justification:
  • Tests not applicable — justification:
  • Sensitive paths changed (security, policy, credentials, preflight, onboarding, inference, runner, sandbox, or messaging)
  • Sensitive-path review completed or maintainer-approved waiver recorded — reviewer/approval link/justification: fail-closed exact-allowlist review completed; no credential, command, transport, dependency, network, or cleanup boundary changed.
  • Non-success, skipped, or missing CI check accepted by maintainer — check name, approval link, and follow-up issue:

DGX Station Hardware Evidence

  • Tested on DGX Station
  • Tested commit:
  • Station profile/scenario:
  • Result:
  • Supporting evidence:

Verification

  • PR description includes a Signed-off-by: line and every commit appears as Verified in GitHub
  • Normal pre-commit, commit-msg, and pre-push hooks passed, or npm run validate:pr passed after refreshing origin/main when hooks were skipped or unavailable
  • Targeted behavior tests pass for the current change set, or tests are marked not applicable above — command/result or justification: 3 affected Vitest files, 89 tests passed.
  • Applicable broad gate passed — npm test for broad runtime/test-harness changes; npm run check for repo-wide validation/coverage changes — command/result:
  • Quality Gates section completed with required justifications or waivers
  • No secrets, API keys, or credentials committed
  • npm run docs builds without warnings (doc changes only)
  • Doc pages follow the style guide (doc changes only)
  • New doc pages include SPDX header and frontmatter (new pages only)

Additional verification: npm run build:cli, npm run typecheck:cli, npm run checks:repository, Oxlint, Prettier, diff checks, and all commit/push hooks passed.


Signed-off-by: Senthil Ravichandran [email protected]

Summary by CodeRabbit

  • New Features

    • Added support for validating native GPU policy configurations with approved filesystem and device access paths.
    • GPU-specific policy enrichment is accepted only when it matches the documented configuration.
  • Bug Fixes

    • Improved validation to reject unexpected additions, removals, duplicates, near-match paths, and unrelated changes.
    • Prevented GPU access rules from being applied to ordinary policies.
    • Added checks to detect live policy changes that differ from the configured policy.
    • Prevented invalid GPU policy updates from being applied after a failed restart-policy update.

@senthilr-nv senthilr-nv self-assigned this Aug 24, 2026
@coderabbitai

coderabbitai Bot commented Aug 24, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: a859d72c-168c-4bec-9ec0-4815ef884d75

📥 Commits

Reviewing files that changed from the base of the PR and between 81d9a65 and af7d9ac.

📒 Files selected for processing (1)
  • src/lib/onboard/experimental/hermes-portable-onboarding.test.ts

Included review availability: Your plan provides up to 12 included reviews per hour; 8 remain after this review.


📝 Walkthrough

Walkthrough

Hermes Portable now accepts the documented OpenShell native-GPU baseline enrichment. It validates approved filesystem and device paths, rejects unsupported policy changes, and checks live-policy agreement with configured receipts outside pending lifecycle phases.

Changes

Native GPU policy validation

Layer / File(s) Summary
Policy constants and create parsing
src/lib/onboard/experimental/hermes-portable-policy-authority.ts
Defines permitted filesystem and device paths. Centralizes create-policy parsing for semantic digest calculation.
Native-GPU enrichment verification
src/lib/onboard/experimental/hermes-portable-policy-authority.ts
Validates the exact OpenShell enrichment and accepts it during base-policy verification. Other mismatches remain rejected.
Configured receipt lifecycle verification
src/lib/onboard/experimental/hermes-portable-onboarding.ts, src/lib/onboard/experimental/hermes-portable-onboarding.test.ts
Compares live-policy and configured-receipt digests outside pending phases. Tests verify rejection before container updates, publication, or active receipt creation.
Native-GPU regression coverage
src/lib/onboard/experimental/hermes-portable-policy-authority.test.ts, src/lib/onboard/experimental/hermes-portable-onboarding.test.ts
Adds fixtures and tests for accepted enrichment and unsupported additions, removals, duplicates, near-match paths, non-filesystem changes, and ordinary policies.

Estimated code review effort: 3 (Moderate) | ~30 minutes

Merge Risk: ⚪ Minimal · up to af7d9

This change narrowly accepts the documented GPU policy enrichment while preserving strict drift rejection; no actionable merge-blocking risk remains.

Sequence Diagram(s)

sequenceDiagram
  participant Onboarding
  participant HermesPortablePolicyAuthority
  participant OpenShellLivePolicy
  participant ConfiguredReceipt
  Onboarding->>HermesPortablePolicyAuthority: Parse create policy and verify live base
  OpenShellLivePolicy->>HermesPortablePolicyAuthority: Provide native-GPU enriched policy
  HermesPortablePolicyAuthority->>HermesPortablePolicyAuthority: Validate approved enrichment
  Onboarding->>ConfiguredReceipt: Read recorded policy digest
  Onboarding->>HermesPortablePolicyAuthority: Compare live and configured digests
  HermesPortablePolicyAuthority-->>Onboarding: Accept or reject policy authority
Loading

Suggested reviewers: prekshivyas, apurvvkumaria

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly summarizes the primary change: accepting Hermes GPU baseline enrichment.
Linked Issues check ✅ Passed The implementation meets the native-GPU acceptance, rejection, digest, fail-closed, and regression-test requirements in [#10121].
Out of Scope Changes check ✅ Passed All production and test changes directly support native-GPU policy validation and lifecycle proof requirements.
Docstring Coverage ✅ Passed Docstring check was indeterminate for this PR — some files could not be analyzed in time. Not blocking.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/hermes-portable-policy-enrichment

Comment @coderabbitai help to get the list of available commands.

@github-code-quality

github-code-quality Bot commented Aug 24, 2026 •

Copy link
Copy Markdown
Contributor

Code Coverage Overview

Languages: TypeScript

TypeScript / code-coverage/plugin

The overall line coverage in commit af7d9ac in the fix/hermes-portable-... branch remains at 96%, unchanged from commit 5a56a77 in the main branch.


Updated August 24, 2026 16:56 UTC

@senthilr-nv senthilr-nv added bug-fix PR fixes a bug or regression integration: hermes Hermes integration behavior area: policy Network policy, egress rules, presets, or sandbox policy area: sandbox OpenShell sandbox lifecycle, runtime, config, or recovery security v0.0.115 labels Aug 24, 2026
@github-actions

github-actions Bot commented Aug 24, 2026 •

Copy link
Copy Markdown
Contributor

PR Review Advisor — Blocking findings reported

Advisor assessment: Blockers require maintainer review
Next action: Review the blockers below.
Findings: 2 blockers · 0 warnings · 0 suggestions
Synthesis status: Completed · high confidence · 2 blockers · 0 warnings · 0 suggestions

E2E guidance

Advisory only. A maintainer can dispatch the default E2E suite for the commit under review.

Recommended E2E: None

Manual-only E2E: onboard-repair, onboard-resume, cloud-onboard
The manual PR workflow does not run these selectors for the commit under review. Run them from reviewed code on main.

Blockers

PRA-1 Blocker — Allow permitted GPU path changes during onboarding retry

  • Location: src/lib/onboard/experimental/hermes-portable-onboarding.ts:741
  • Category: acceptance
  • Problem: The retry path compares the complete live-policy digest after the policy authority has accepted a native-GPU enrichment. An allowed GPU device-path change then blocks a configuring receipt from resuming.
  • Impact: After a later configuration failure, the receipt-owned sandbox can remain unregistered and the configuring receipt cannot converge through retry when OpenShell reports another permitted GPU device path.
  • Fix: Store and compare a normalized proof that treats only the permitted native-GPU device-path variation as equivalent. Preserve strict comparison for all other policy content and path changes. If such drift must reject, remove the receipt-owned sandbox and receipt deterministically and report the recovery action.
  • Verification: Inspect the partial-failure retry test with /dev/nvidia0 changed to /dev/nvidia1 and verify that retry reaches active without a second create, or that cleanup removes the owned state.
  • Test coverage: Extend the partial-failure retry test so a permitted GPU device-path change either reaches active without another create or proves deterministic cleanup leaves no receipt-owned sandbox or pending/configuring receipt.
  • Evidence: src/lib/onboard/experimental/hermes-portable-policy-authority.ts:169-253 permits native-GPU enrichment and accepts device paths matching /^\/dev\/nvidia[0-9]+$/. src/lib/onboard/experimental/hermes-portable-policy-authority.ts:309-314 returns the complete full-policy semantic digest after accepting the enrichment. src/lib/onboard/experimental/hermes-portable-onboarding.ts:735-744 rejects a configuring receipt when that digest differs from the digest stored earlier. src/lib/onboard/experimental/hermes-portable-onboarding.test.ts:903-926 changes /dev/nvidia0 to /dev/nvidia1 after a restart-policy failure and asserts that retry rejects before registry publication.

PRA-2 Blocker — Prevent retained owned state when a permitted GPU policy changes on retry

  • Location: src/lib/onboard/experimental/hermes-portable-onboarding.ts:741
  • Category: security
  • Problem: The exact live-policy digest check rejects a configuring retry when OpenShell reports another device path that the changed policy authority permits. The failure retains the receipt-owned sandbox and durable configuring state without a demonstrated recovery path.
  • Impact: A partial onboarding failure can retain an unregistered sandbox and block recovery. This breaks lifecycle-state integrity and leaves an owned resource outside the completed registry state.
  • Fix: Use the permitted-GPU normalized proof for receipt retry comparison, or implement deterministic cleanup of the receipt-owned sandbox and receipt on this rejection. Keep all non-permitted policy drift denied.
  • Verification: Review the changed partial-failure test and confirm the retry has neither a convergent path nor cleanup after the digest mismatch.
  • Test coverage: Test a partial failure followed by an allowed GPU device-path change and assert active publication without duplicate create, or assert removal of the owned sandbox and durable receipt.
  • Evidence: src/lib/onboard/experimental/hermes-portable-policy-authority.ts:169-253 permits native-GPU device paths matching /^\/dev\/nvidia[0-9]+$/. src/lib/onboard/experimental/hermes-portable-onboarding.ts:735-744 rejects a changed complete live-policy digest for a non-pending receipt. src/lib/onboard/experimental/hermes-portable-onboarding.test.ts:903-926 demonstrates rejection after /dev/nvidia0 changes to /dev/nvidia1 and asserts no registry or active receipt is published.

Workflow run details

This automated review informs maintainers. Warnings and suggestions do not require a response. A maintainer decides whether to merge.

@senthilr-nv

Copy link
Copy Markdown
Collaborator Author

Addressed PRA-1 in replacement revision af7d9ac. Configuring and active policy proofs now must match the live-policy digest already stored in the configured receipt; pending remains the only phase that establishes it. The regression records one accepted native-GPU enrichment, stops before registry publication, resumes with a different individually allowed GPU device set, and proves rejection before restart-policy mutation, registry publication, or active publication. Validation: 90/90 focused policy/onboarding/lifecycle tests PASS; CLI typecheck, Oxlint, repository checks, growth guardrails, secret scan, DCO, signatures, commit hooks, and pre-push typecheck PASS.

@cv
cv merged commit 0ed75e1 into main Aug 24, 2026
100 of 113 checks passed
@cv
cv deleted the fix/hermes-portable-policy-enrichment branch August 24, 2026 18:02
@wscurran wscurran added area: security Security controls, permissions, secrets, or hardening and removed security labels Oct 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: policy Network policy, egress rules, presets, or sandbox policy 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 integration: hermes Hermes integration behavior

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Hermes Portable rejects OpenShell native-GPU policy enrichment

4 participants