Skip to content

feat: NemoClaw governance tab — wire into theme 2, fix duplicate JS#398

Open
vivekchand wants to merge 1 commit intomainfrom
feat/nemoclaw-governance-tab
Open

feat: NemoClaw governance tab — wire into theme 2, fix duplicate JS#398
vivekchand wants to merge 1 commit intomainfrom
feat/nemoclaw-governance-tab

Conversation

@vivekchand
Copy link
Copy Markdown
Owner

What this does

Completes the NemoClaw governance tab implementation by fixing a bug where the tab was implemented in theme 1 (the overwritten DASHBOARD_HTML) but not in theme 2 (the actually-served template).

Changes

Frontend (theme 2 HTML):

  • Added NemoClaw nav tab to the theme 2 tab bar (hidden by default, revealed on load when NemoClaw is detected)
  • Added #page-nemoclaw content div to theme 2 — matching the layout from the spec:
    • 🟢 Status header with sandbox name + blueprint version badges
    • Two-column SANDBOX / INFERENCE info grid
    • ACTIVE POLICY section with hash badge, drift alert, and parsed network policies table
    • APPLIED PRESETS chip row
  • Wired switchTab('nemoclaw') into theme 2's switchTab() function
  • Fixed: duplicate loadNemoClaw() stub in theme 2 shadow-overrode the real implementation — wrapped in if(false){} to disable it

Backend (already in previous commit):

  • _detect_nemoclaw() helper — reads config, state, policy YAML, and presets from ~/.nemoclaw/
  • _parse_network_policies() — parses YAML network_policies section (PyYAML with line-parser fallback)
  • /api/nemoclaw/governance — full status endpoint with sandbox list, policy hash, drift detection
  • /api/nemoclaw/governance/acknowledge-drift — clears drift alert
  • /api/nemoclaw/status — lightweight status check
  • /api/nemoclaw/policy — policy YAML + hash + drift status
  • Module-level _nemoclaw_policy_hash for in-memory drift detection
  • NemoClaw accent color: #76b900 (NVIDIA green)

Testing

The tab is hidden on load and only shown when /api/nemoclaw/governance returns installed: true. On hosts without NemoClaw, nothing changes.

…urn (closes #300)

- New /api/model-attribution endpoint: scans JSONL sessions for model_change
  events and assistant messages to build per-model turn/session counts
- Returns: models[], primary_model, total_turns, model_count, switches, switch_count
- Models tab added to both dashboard themes (light + dark)
- Bar chart of model mix with percentage share per model
- Per-session breakdown table (model, sessions, turns, share%)
- Model switch history section (when models change mid-session)
- Stat cards: primary model, diversity, fallback rate, total turns
- 5 new tests, all 76 tests pass
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant