Skip to content

feat: Unified PAI + IronClaw Dashboard (Phases 0-4)#1

Open
curtitoo wants to merge 34 commits intomainfrom
feat/unified-architecture
Open

feat: Unified PAI + IronClaw Dashboard (Phases 0-4)#1
curtitoo wants to merge 34 commits intomainfrom
feat/unified-architecture

Conversation

@curtitoo
Copy link
Copy Markdown
Owner

@curtitoo curtitoo commented Feb 17, 2026

Summary

Unified dashboard architecture integrating PAI native capabilities alongside the existing IronClaw proxy layer, implementing the "Layered Sovereignty" model where IronClaw serves as the outer security authority and PAI as the inner cognitive authority.

Phase 0-2: Foundation & Bridged Views

  • PAI heartbeat API + daemon state library for connectivity triage
  • Bridged Memory, Logs, and Settings pages with PAI + IronClaw tabs
  • PAI-native API routes: /api/pai/memory, /api/pai/logs, /api/pai/settings
  • SSE reconnect with exponential backoff (RedTeam finding fix)

Phase 3: Anti-Corruption Layer

  • PAI-owned type definitions for all 8 domains (types/pai.ts)
  • IronClaw-to-PAI mapper functions (lib/ironclaw-mapper.ts)
  • Migrated Agents, Routines, Extensions, Overview, and Ask pages to PAI types
  • Phase 3 deferral comments on remaining IronClaw proxy write operations

Phase 4: Governance & Security Visibility

  • Settings classification: Critical / Operational / Informational tiers
  • Critical settings guard with confirmation dialog + JSONL audit trail
  • Security Event Viewer surfacing SecurityValidator audit logs
  • Escape Hatch Alert (red banner when SECURITY_OVERRIDE active)
  • Hook Health Indicator (green/amber/red status)
  • Governance reference table documenting the authority model
  • Code review fixes: stripped session_id from API response, fixed prefix matching

Architecture

  • 32 commits across 4 phases, ~1200 LOC added
  • 5 new API routes, 1 new page (/governance), 1 new library (settings-governance.ts)
  • 0 TypeScript errors (tsc --noEmit clean)
  • No auth tokens or sensitive data exposed in any API response
  • Anti-Corruption Layer prevents IronClaw type leakage into PAI domain

Test Plan

  • next build compiles with 0 errors
  • Sidebar shows Governance link in System section with Shield icon
  • /governance page loads showing security events, escape hatch status, hook health, reference table
  • Settings page shows tier badges (Critical=red, Info=gray) on IronClaw settings
  • Changing safety.injection_check_enabled triggers confirmation dialog
  • After confirming, MEMORY/SECURITY/settings-audit.jsonl has new entry
  • Creating ~/.claude/SECURITY_OVERRIDE shows red banner on governance page
  • Informational settings (server.*, paths) are read-only
  • All existing pages (Overview, Agents, Ask, etc.) unaffected
  • No session_id exposed in /api/pai/security-events response

🤖 Generated with Claude Code

Co-Authored-By: Claude Opus 4.6 noreply@anthropic.com

curtitoo and others added 30 commits February 17, 2026 01:17
Captures the Layered Sovereignty architecture (IronClaw-First approach)
from multi-session brainstorming. Classifies 11 IronClaw features as
KEEP/BRIDGE/PAI-NATIVE and defines 5-phase implementation rollout.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…0-2)

Detailed step-by-step plan covering heartbeat triage script, daemon state
bridge, Radix Tabs component, PAI Memory/Logs/Settings API routes,
bridged dashboard pages with tabs, and SSE circuit breaker fix.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Phase 0 of unified architecture — IronClaw cron invokes heartbeat-triage.sh
for lightweight PAI system health checks with escalation to full sessions.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Phase 1 state bridge — dashboard can read heartbeat triage results
from daemon-state.json written by heartbeat-triage.sh.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Replaces fixed 3s retry with exponential backoff (3s → 6s → 12s... cap 60s)
and max 10 retries. Resets on successful connection. Prevents reconnection
storm if IronClaw is flapping.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Log level case: API now returns lowercase to match client type union
- Daemon-state schema: TS interface matches heartbeat-triage.sh output
- macOS compat: replace GNU find -printf with -exec basename
- Import style: standardize on bare specifiers (fs, path, os)
- Fix misleading JSDoc on lastNLines helper

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Server-side mapper approach: PAI-owned types in types/pai.ts,
mapping functions in lib/mappers.ts, new /api/pai/* routes for
all 8 IronClaw domains. Pages consume PAI types only.

Enables selective IronClaw updates (Requirement danielmiessler#3) by
centralizing type translation in one mapper file.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
10-task plan covering types/pai.ts, lib/mappers.ts, 6 new API routes,
and 8 page migrations. ~650 new LOC + ~150 changed LOC.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Pure mapping functions that convert IronClaw API types to PAI-owned
types. This is the single file that absorbs IronClaw API changes —
when IronClaw renames a field, only this file needs to change.

Covers all 8 domains: agents, routines, chat, SSE, extensions,
memory, logs, settings, plus generic action/gateway types.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Replace IronClaw type imports (Job, JobSummary, JobStatus, JobDetail,
JobEvent) with PAI equivalents (PAIAgent, AgentSummary, AgentStatus,
PAIAgentDetail, AgentEvent). Consolidate dual-fetch patterns into
single /api/pai/agents endpoints. Rename all snake_case field access
to camelCase PAI fields throughout both agents list and detail pages.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Overview page: AgentSummary/PAIRoutineSummary/PAIAgent types, /api/pai/* routes
- Ask page: PAIStreamEvent/PAIChatThread types (chat routes stay on IronClaw proxy)
- SSE hook: PAIStreamEvent type for event parsing

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Extensions write operations and chat routes intentionally stay on
IronClaw proxy until PAI API route counterparts are added in Phase 4.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Classifies IronClaw settings into critical/operational/informational
tiers and provides JSONL audit logging for critical changes.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Security visibility and authority model page with:
- Security events table (blocks, confirms, alerts)
- Settings audit log
- Hook health status indicator
- Escape hatch override alert banner
- Authority model reference table (IronClaw/PAI domains)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
curtitoo and others added 3 commits February 17, 2026 11:55
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
C2: Security-events endpoint now strips session_id before returning
events to prevent information disclosure of internal tracing data.

I1: classifySetting() prefix matching fixed in both settings-governance.ts
and settings/page.tsx — was using `startsWith(p)` which over-matched
(e.g. sandbox.policy_extra matched sandbox.policy). Now uses exact
match OR dot-delimited sub-key match only.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@curtitoo curtitoo changed the title feat: Unified PAI + IronClaw Dashboard Architecture (Phases 0-3) feat: Unified PAI + IronClaw Dashboard (Phases 0-4) Feb 17, 2026
Backend library (lib/cc-mirror.ts) reads/writes CC-Mirror variant
configs with security whitelist — only model tier env vars and timeout
multiplier are exposed, auth tokens never leave the server.

Two API routes:
- GET /api/cc-mirror/variants — list all variants with safe metadata
- PUT /api/cc-mirror/variants/:name — update model tiers with validation

Inference page shows card per variant (orouter, kimiclaude, miniClaude)
with inline edit for fast/standard/smart model tiers and timeout
multiplier. Sidebar link was already in place from Phase 4.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
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