fix(recipe): harden Hermes auto-heal recovery - #70
Conversation
Signed-off-by: Meenakshi Kaushik <1818024+mkhaas@users.noreply.github.com>
0550c3f to
de70f43
Compare
Signed-off-by: Apurv Kumaria <akumaria@nvidia.com>
Use the managed OpenShell supervisor lifecycle, verify exact Slack authorization state, repair only known writable artifacts without following symlinks, and cover recovery command contracts. Co-authored-by: Meenakshi Kaushik <1818024+mkhaas@users.noreply.github.com> Signed-off-by: Apurv Kumaria <akumaria@nvidia.com>
|
Maintainer hardening is ready for independent review at Local evidence is green: the focused watchdog command-contract test, 9 auto-heal Python tests, Bash syntax, ShellCheck v0.11.0, shfmt v3.12.0, SPDX, governance, and diff checks. Meenakshi's original signed commit remains intact, and the maintainer commit explicitly credits her as co-author. @wscurran @ericksoa @cv: please review the managed OpenShell supervisor lifecycle and exact mutually exclusive Slack policy handling. This PR still needs disposable Docker/OpenShell live evidence before merge: observed container lifecycle change, non-root workload identity, health 200, Slack and configured Outlook provider continuity, and the documented ownership/mode checks. Please do not merge based on local mocks alone. |
Signed-off-by: Apurv Kumaria <akumaria@nvidia.com>
|
Maintainer correction at The prior head incorrectly assumed that OpenShell v0.0.72 would replay the sandbox-create command after a Docker restart. It does not. The corrected recovery now:
The command-contract test, 9 Python tests, Bash syntax, ShellCheck 0.11.0, scoped shfmt 3.12.0, Python compilation, SPDX, governance, and diff checks pass. An independent static audit found no remaining code-level blocker. This PR is still not ready to merge until the disposable Linux/OpenShell v0.0.72 validation matrix in the PR description passes, including @wscurran @ericksoa @cv: please review the corrected lifecycle at this exact head, but do not approve it for merge based on mocked validation alone. |
|
New cross-PR lifecycle evidence must be resolved before this exact head can merge. PR #91 at Please treat this as part of the existing disposable OpenShell v0.0.72 live gate. The validation must demonstrate the exact restart path after the bootstrap token is older than one hour, show that the supervisor returns without |
Signed-off-by: Apurv Kumaria <akumaria@nvidia.com>
Signed-off-by: Apurv Kumaria <akumaria@nvidia.com>
apurvvkumaria
left a comment
There was a problem hiding this comment.
The stale-bootstrap-token recovery defect has now been addressed at d2aa95a: raw container restart is removed, the existing OpenShell supervisor remains in place, recovery stops only the known Hermes runtime, verifies non-root sandbox execution, repairs bounded writable paths, and relaunches through the managed exec path. Focused local tests, SPDX, governance, and whitespace checks pass.
The following external gates still block merge:
- Please add your own DCO declaration to the PR description exactly as follows so the current required check can attest the contribution:
Signed-off-by: Meenakshi Kaushik <1818024+mkhaas@users.noreply.github.com> - Update the PR description to remove the now-stale raw-container-restart and lifecycle-marker claims.
- Provide disposable Linux/OpenShell end-to-end evidence for the updated recovery path: non-root relaunch, exactly one new Hermes gateway/runtime tree, health 200, Slack Socket Mode and configured Outlook/provider/CA continuity, bounded ownership/mode repair, tear-down/uninstall behavior, and logs free of credentials or temporary Socket Mode tickets.
This remains changes-requested until the contributor DCO declaration and live operational proof are present. The original contributor commit and attribution remain intact.
Signed-off-by: Apurv Kumaria <akumaria@nvidia.com>
Superseded by maintainer follow-up at 7ecd97a: the approved maintainer DCO/attribution approach, PR description correction, and local/disposable Linux validation are complete. A narrower current review records the sole remaining external operational gate.
apurvvkumaria
left a comment
There was a problem hiding this comment.
Maintainer follow-up at 7ecd97a: the PR now uses Apurv Kumaria’s valid DCO sign-off while preserving Meenakshi Kaushik’s original signed commit and explicit attribution. The stale raw-container-restart claims are removed. All required GitHub checks pass, the rendered systemd unit verifies on Linux, and a disposable Docker contract proves exact container selection, unchanged container lifecycle, targeted Hermes termination, bounded ownership repair without symlink-target traversal, and supervisor survival. No remaining code-level change is identified.
One external operational gate still blocks merge: run the configured recovery matrix on a disposable Linux/OpenShell host and attach evidence for non-root relaunch, exactly one new Hermes tree, health 200, Slack Socket Mode, configured Outlook/provider/CA continuity, teardown/uninstall behavior, and secret-safe logs. This environment has no registered OpenShell gateway or Slack/Outlook/provider credentials, so that live integration evidence cannot be produced here.
Fixes NVIDIA/NemoClaw#7671
What changed
Readyand OpenShell exec to run as the non-rootsandboxuser before relaunchopenshell sandbox exec --name ${SANDBOX_NAME} -- /usr/local/bin/nemoclaw-startsandboxUID, health, and the exact Slack policy before reporting recoverymissing_scopeandnot_in_channelas transport failuresRoot cause
A single transient health-probe failure triggered recovery. The original watchdog then launched the full Hermes entrypoint with raw
docker exec. OpenShell's Docker container runs its outer supervisor as root, so that path used the wrong identity and could leave a root-owned runtime tree.OpenShell v0.0.72 does not persist or replay the trailing sandbox-create command when its Docker container restarts. Recovery must therefore leave the container and its OpenShell supervisor running, stop only known Hermes runtime processes, verify a non-root OpenShell exec session, repair bounded writable state, and relaunch Hermes through that managed session.
Security and attribution
chown --no-dereference --recursive/sandbox/.hermesconfiguration is excludedValidation completed
bash scripts/autoheal/tests/test_watchdog.shpython3 -m unittest discover -s scripts/autoheal/tests -p 'test_*.py'(9 tests)systemd-analyze verifyon the rendered runtime unit in disposable Linuxgit diff --checkRemaining external operational validation
Before merge, run the documented recovery matrix on a disposable Linux host with Docker-backed OpenShell and configured integrations:
sandboxauth.testandapps.connections.opensucceed, and the exact mutually exclusive Slack policy is presentAttribution and DCO
Original contribution by Meenakshi Kaushik (@mkhaas). Her original signed commit remains intact, and the maintainer hardening commit preserves her co-authorship credit.
Signed-off-by: Apurv Kumaria akumaria@nvidia.com