Skip to content

fix(rebuild): preserve Hermes default kanban board database - #7096

Merged
apurvvkumaria merged 12 commits into
NVIDIA:mainfrom
tyeth-ai-assisted:fix/hermes-rebuild-backup-kanban
Jul 18, 2026
Merged

fix(rebuild): preserve Hermes default kanban board database#7096
apurvvkumaria merged 12 commits into
NVIDIA:mainfrom
tyeth-ai-assisted:fix/hermes-rebuild-backup-kanban

Conversation

@tyeth-ai-assisted

@tyeth-ai-assisted tyeth-ai-assisted commented Jul 17, 2026

Copy link
Copy Markdown
Contributor

Summary

Hermes rebuild backup silently drops the backward-compatible default kanban board database. This change preserves only ~/.hermes/kanban.db using the existing online SQLite backup strategy.

The sibling kanban/ tree is intentionally excluded. Named-board databases, attachments, worker logs, scratch workspaces, and external dir/worktree targets need a separate durability design before they can safely enter the rebuild state contract.

Related Issue

Partially addresses #7095

Changes

  • Add kanban.db to the Hermes state_files manifest with strategy: sqlite_backup.
  • Keep kanban out of state_dirs so the rebuild path does not make an incomplete or inconsistent archive of live and externally rooted state.
  • Add focused coverage proving that the default database is restored while named boards, attachments, logs, scratch data, and external workspaces remain untouched.
  • Split the focused regression out of test/snapshot.test.ts, removing the temporary file-size ratchet.

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:
  • Docs updated for user-facing behavior changes
  • Docs not applicable — justification: this narrows an internal rebuild-state manifest contract and adds no new user workflow.
  • 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: maintainer follow-up narrows persistence to one SQLite database and explicitly excludes the unsafe whole-tree copy.
  • Non-success, skipped, or missing CI check accepted by maintainer — check name, approval link, and follow-up issue:

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 equivalent targeted checks passed when hooks were unavailable — note: local prek was unavailable; Biome, test-size, title-style, and diff checks passed.
  • Targeted behavior tests pass for the current change set — result: 49 targeted integration tests passed; the focused post-format test passed 1/1.
  • 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)

Responsible human: @tyeth (please review) — opened on their behalf by tyeth-ai-assisted.

Signed-off-by: tyeth tyethgundry@googlemail.com

Summary by CodeRabbit

  • New Features
    • Added durable backup and restore support for Hermes’ default Kanban board database.
    • Kanban database state is preserved using SQLite-aware backups during sandbox state operations.
    • Other Kanban-related data—including named boards, attachments, worker logs, scratch workspaces, and external worktree targets—is not included in this durability coverage.

kanban.db (a durable SQLite task board: tasks, comments, events, runs) and the kanban/ workspaces directory were not listed in the Hermes agent manifest state contract, so every sandbox rebuild silently dropped the board while restoring the rest of the agent state.

Add kanban to state_dirs and kanban.db (sqlite_backup strategy, matching runtime/state.db) to state_files.

Signed-off-by: tyeth <tyethgundry@googlemail.com>
@copy-pr-bot

copy-pr-bot Bot commented Jul 17, 2026

Copy link
Copy Markdown

This pull request requires additional validation before any workflows can run on NVIDIA's runners.

Pull request vetters can view their responsibilities here.

Contributors can view more details about this message here.

@coderabbitai

coderabbitai Bot commented Jul 17, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

The Hermes durable-state manifest now includes kanban.db with SQLite online backup handling. Snapshot tests verify database-only Kanban backup and restore behavior while excluding Kanban directories, attachments, logs, workspaces, and external worktree paths.

Changes

Hermes Kanban state

Layer / File(s) Summary
Declare Kanban database state
agents/hermes/manifest.yaml
Adds kanban.db to state_files with the sqlite_backup strategy and documents excluded Kanban artifacts.
Validate Kanban database backup and restore
test/hermes-kanban-snapshot.test.ts, test/snapshot.test.ts
Adds isolated backup/restore integration coverage and updates snapshot expectations and SSH stubs for the new database entry.

Estimated code review effort: 2 (Simple) | ~10 minutes

Suggested reviewers: ericksoa, laitingsheng

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Linked Issues check ⚠️ Warning The PR backs up kanban.db but not kanban/, so it does not fully preserve kanban state as required. Add kanban to state_dirs and restore its workspaces/artifacts, or narrow the linked issue scope if the database-only fix is intended.
✅ Passed checks (4 passed)
Check name Status Explanation
Out of Scope Changes check ✅ Passed The manifest and test changes are all related to Hermes kanban rebuild durability; no unrelated scope is evident.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately reflects the main change: preserving Hermes kanban data by adding the default board database to rebuild backups.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@agents/hermes/manifest.yaml`:
- Around line 87-91: Update the Hermes manifest’s kanban state configuration so
backupSandboxState does not recursively preserve ephemeral scratch workspaces.
Split the durable kanban data, such as worktree/dir state and run logs, from
scratch workspace paths and declare only the durable directory in stateDirs,
using the existing kanban layout and backup mechanisms.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: a3891b4e-97f3-4c5c-8662-70ee2af8268b

📥 Commits

Reviewing files that changed from the base of the PR and between aa3dd78 and 218f8e3.

📒 Files selected for processing (1)
  • agents/hermes/manifest.yaml

Comment thread agents/hermes/manifest.yaml Outdated
@github-actions

github-actions Bot commented Jul 17, 2026

Copy link
Copy Markdown
Contributor

PR Review Advisor — Informational

Advisor assessment: Informational / high confidence
Next action: No advisor follow-up needed.
Findings: 0 blockers · 0 warnings · 0 suggestions
Status: No actionable findings remain in the canonical review ledger.

Model lanes

  • GPT-5.6 Terra (primary): Completed · high confidence · 0 blockers · 0 warnings · 0 suggestions
  • Nemotron 3 Ultra (second opinion): Completed · high confidence · 0 blockers · 0 warnings · 0 suggestions
  • Model comparison: normalized findings match; normalized E2E selections differ; severity counts match.

Nemotron output stays in workflow artifacts and does not change the assessment above.

E2E guidance

Advisory only. E2E / PR Gate selects and runs jobs independently.

Recommended E2E: cloud-onboard, credential-sanitization, full-e2e, hermes-e2e, security-posture, rebuild-hermes, rebuild-hermes-stale-base

Workflow run details

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

…pshot

Addresses PR Review Advisor blocker PRA-1: the Hermes durable-state snapshot fixture pinned the pre-change contract (SOUL.md, .hermes_history, runtime/state.db only).

- Seed kanban.db and kanban/workspaces content in the fixture
- Extend the fake SSH shim: dir existence check reports kanban, pre-backup audit walks the seeded state dir for unsafe entries, tar handlers stream the kanban dir both ways, and the SQLite backup/restore handlers key on the target path so kanban.db and runtime/state.db stay distinct
- Update backup/restore expectations for the expanded manifest contract
- Add a negative case: an unsafe symlink inside kanban/ makes the pre-backup security audit reject the backup (NC-2227-04 coverage on the new writable state surface)

Both tests pass locally: npx vitest run test/snapshot.test.ts -t Hermes / -t 'unsafe symlink'.

Signed-off-by: tyeth <tyethgundry@googlemail.com>
@tyeth-ai-assisted

Copy link
Copy Markdown
Contributor Author

Addressed PRA-1 in 4f18245: the Hermes durable-state snapshot fixture now seeds kanban.db and kanban/workspaces content, the fake SSH shim handles the dir existence check, pre-backup audit, tar streaming in both directions, and path-keyed SQLite backup/restore for the second database, and the backup/restore expectations match the expanded manifest contract. A negative case covers the NC-2227-04 security audit on the new writable surface (unsafe symlink inside kanban/ rejects the backup).

Verified locally:

npx vitest run test/snapshot.test.ts -t "Hermes"          # 1 passed
npx vitest run test/snapshot.test.ts -t "unsafe symlink"  # 1 passed

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@test/snapshot.test.ts`:
- Around line 1420-1435: Update the fake audit walker around the local walk
function to report regular files with st.nlink > 1 as hard links, matching the
production audit’s output and rejection behavior. Add this handling before the
generic regular-file path while preserving existing symlink, directory, and
special-file reporting; avoid broad mocks that bypass the behavior under test.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: 473f1ccc-1ef1-409f-b922-786eb381dc4e

📥 Commits

Reviewing files that changed from the base of the PR and between 218f8e3 and 4f18245.

📒 Files selected for processing (1)
  • test/snapshot.test.ts

Comment thread test/snapshot.test.ts Outdated
The fake audit walker in the Hermes snapshot fixture claimed to mirror the production pre-backup audit but never reported regular files with st.nlink > 1, so fixture-based hard-link coverage would pass where production rejects. Emit an 'f' row for hard-linked regular files, matching find's -type f -a -links +1 branch.

Both Hermes snapshot tests re-verified locally with vitest.

Signed-off-by: tyeth <tyethgundry@googlemail.com>
The kanban coverage added for PRA-1 grew test/snapshot.test.ts past the 1500-line default ceiling (now 1598 lines). Add the ratchet entry at the file's exact current length, per the check's lower-the-budget contract (scripts/check-test-file-size-budget.mts rejects any headroom).

Verified locally: npx tsx scripts/check-test-file-size-budget.mts passes (1627 files scanned).

Signed-off-by: tyeth <tyethgundry@googlemail.com>
@wscurran wscurran added area: sandbox OpenShell sandbox lifecycle, runtime, config, or recovery bug-fix PR fixes a bug or regression integration: hermes Hermes integration behavior labels Jul 17, 2026
@wscurran

Copy link
Copy Markdown
Contributor

✨ Thanks for the fix. Adding the kanban board to the Hermes backup manifest ensures board tasks, comments, events, runs, and workspaces survive rebuilds. Ready for maintainer review.


Related open issues:


Related open issues:

Preserve only the backward-compatible default-board SQLite database and explicitly exclude state that cannot be safely or completely archived by the current manifest contract.

Co-authored-by: tyeth <tyethgundry@googlemail.com>
Signed-off-by: Apurv Kumaria <akumaria@nvidia.com>
@apurvvkumaria apurvvkumaria changed the title fix(rebuild): include Hermes kanban board in the backup manifest fix(rebuild): preserve Hermes default kanban board database Jul 17, 2026
@cv

cv commented Jul 18, 2026

Copy link
Copy Markdown
Collaborator

Deferred for the v0.0.88 review pass on exact head 89477fd18 because the mandatory maintainer gate cannot validate GitHub’s approved-fork attempt metadata. The code review is clean; test-size:check passed, the two focused snapshot suites passed 50/50, all native checks are green (36 success, 5 intentional skips), and the audited credential-bearing E2E skip was recorded successfully without exposing secrets. However, approving the held fork workflows changed them to attempt 2 with empty PR-association metadata, and check-gates.ts now fails closed with 30 “latest attempt evidence incomplete” contexts. Project policy permits approval only when allPass is true. Backfill or fix the exact-diff attempt evidence/checker handling, then rerun the deterministic gate for this unchanged head before approval.

@cv cv left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Deferred at exact head 42116bf. Direct salvage added real Hermes kanban CLI rebuild persistence coverage and corrected backup-scope docs; non-secret CI and exact-head advisor review are green, and the credentialed fork E2E omission was recorded as a policy-approved audited skip. The deterministic gate still fails closed because GitHub returned empty PR associations for 32 approved attempt-2 workflow contexts, so this revision is not approval-ready.

@cv cv left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved. Security review: PASS. Preservation is limited to the default Hermes kanban SQLite database, uses SQLite-safe backup/restore behavior, and does not claim attachments or external workspaces. Focused snapshot and rebuild coverage passes; standard fork CI and the protected E2E decision remain merge gates.

@apurvvkumaria
apurvvkumaria merged commit bf87083 into NVIDIA:main Jul 18, 2026
43 checks passed
@tyeth

tyeth commented Jul 20, 2026

Copy link
Copy Markdown
Contributor

Thanks everyone for picking this up! 💌

@ericksoa ericksoa mentioned this pull request Jul 20, 2026
21 tasks
ericksoa added a commit that referenced this pull request Jul 20, 2026
<!-- markdownlint-disable MD041 -->
## Summary

Add the canonical dated changelog entry for NemoClaw `v0.0.89` before
the release plan captures the tag commit.
The entry summarizes the user-visible Station preparation, inference,
recovery, policy-disclosure, and CLI-containment changes merged since
`v0.0.88`.

## Changes

- Add `docs/changelog/2026-07-20.mdx` with the exact `## v0.0.89`
release heading, parser-safe SPDX comment, summary, and detailed
bullets.
- Link each shipped theme to the most specific published OpenClaw
documentation routes.
- Keep internal E2E, advisory-registry, and review-workflow refactors
out of the user-facing release summary.

Source summary:

- #7214, #7241, #7237, #7223, #7204, #7202, #7183, and #7090 ->
`docs/changelog/2026-07-20.mdx`: Summarize qualified DGX Station
identity, package-state, PackageKit, DKMS, and reboot-handoff fixes.
- #7242, #7221, #7186, #7164, and #6874 ->
`docs/changelog/2026-07-20.mdx`: Summarize inference endpoint
provenance, provider attachment, managed vLLM cleanup and progress, and
Ollama selection guidance.
- #7225, #7216, #7192, #7136, #7096, and #6910 ->
`docs/changelog/2026-07-20.mdx`: Summarize sandbox readiness, recovery
guidance, rebuilt model routing, durable Hermes state, and gateway
restart behavior.
- #7187 -> `docs/changelog/2026-07-20.mdx`: Summarize complete effective
messaging-preset egress disclosure before policy mutation.
- #7218, #7165, and #7184 -> `docs/changelog/2026-07-20.mdx`: Summarize
structured output containment, terminal-safe route display, and Hermes
forward cleanup.

## Type of Change

- [ ] Code change (feature, bug fix, or refactor)
- [ ] Code change with doc updates
- [x] 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:
- [x] Tests not applicable — justification: This PR adds release-history
prose only; the focused changelog contract test validates its required
structure and routes.
- [x] Docs updated for user-facing behavior changes
- [ ] Docs 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:
- [ ] Non-success, skipped, or missing CI check accepted by maintainer —
check name, approval link, and follow-up issue:

## Verification

- [x] PR description includes a `Signed-off-by:` line and every commit
appears as `Verified` in GitHub
- [x] Normal `pre-commit`, `commit-msg`, and `pre-push` hooks passed, or
`npm run check:diff` passed when hooks were skipped or unavailable
- [x] Targeted behavior tests pass for the current change set, or tests
are marked not applicable above — `mise exec node@22.23.1 -- npx vitest
run test/changelog-docs.test.ts` (6 passed).
- [ ] Applicable broad gate passed — `npm test` for broad
runtime/test-harness changes; `npm run check` for repo-wide
validation/coverage changes — not applicable to this doc-only release
entry.
- [x] Quality Gates section completed with required justifications or
waivers
- [x] No secrets, API keys, or credentials committed
- [ ] `npm run docs` builds without warnings (doc changes only) — `mise
exec node@22.23.1 -- npm run docs` completed with 0 errors and 2
existing site-wide warnings.
- [x] Doc pages follow the [style
guide](https://github.com/NVIDIA/NemoClaw/blob/main/docs/CONTRIBUTING.md)
(doc changes only)
- [ ] New doc pages include SPDX header and frontmatter (new pages only)
— the native changelog entry uses the required parser-safe MDX SPDX
comment and does not use frontmatter.

---
Signed-off-by: Aaron Erickson <aerickson@nvidia.com>


<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->

## Summary by CodeRabbit

* **New Features**
* Expanded DGX Station installation support for qualified GB300 and
OTA-upgraded environments.
* Preserved selected inference providers, endpoints, model pins, and
tuning settings during sandbox creation and rebuilds.
* Improved sandbox recovery by validating availability and stability
before restarting services.
* Added clearer policy output showing the complete effective messaging
egress configuration.

* **Bug Fixes**
* Hardened status and inference route displays by sanitizing terminal
control characters.
* Improved Hermes uninstall behavior by stopping detached dashboard
forwarding.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->

Signed-off-by: Aaron Erickson <aerickson@nvidia.com>
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 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.

6 participants