This repository was archived by the owner on May 26, 2026. It is now read-only.
feat(kora): KR-FE-COCKPIT-NAV-RESTRUCTURE-AND-ALERT-VIEWER-VERIFICATION — sidebar groups + alert viewer aligned to real #197#202
Merged
Conversation
…ON — sidebar groups + alert viewer aligned to real #197 shape Two deliverables — primary is the sidebar restructure CC#2 flagged in #198 (past 25 entries, hard to scan), secondary is the verification that AlertInvestigationsPage (built forward-compat in #198) actually renders correctly against real #197 alert.investigation_completed payloads. A) KR-FE-COCKPIT-NAV-RESTRUCTURE * BUILTIN_NAV_REST replaced with BUILTIN_NAV_GROUPS — 9 groups: Overview / Watch / Email / Promotion Loops / Activity & Reasoning / Control & Tickets / Daemon & Listeners (collapsed) / Settings (collapsed) / Diagnostic & Docs (collapsed). * New SidebarNavGroup component with collapsible header, keyboard-actionable (aria-expanded / aria-controls). * Per-group badgeCount = sum of in-group items' badge values ("Promotion Loops 3" without expanding). * useSidebarGroupCollapse hook — localStorage-persisted per-group state (versioned key: kora.sidebar.groupCollapse.v1). * Operator-priority groups stay expanded by default; less-used groups (Daemon / Settings / Diagnostic) default collapsed. * Plugin items still render as their own bottom section (existing behavior preserved). * Drift-guards: SIDEBAR_GROUP_KEYS_IN_ORDER + SIDEBAR_PATH_TO_GROUP exports + orphan-path test (every nav path must belong to exactly one group; new pages added without a group placement fail at CI) + canonical group order pin + default-collapse set pin + render-uses-groups pin. B) KR-FE-ALERT-VIEWER-VERIFICATION * SURPRISE: #197 does NOT emit a separate alert.wake_requested seam — only alert.investigation_completed. The forward-compat endpoint built in #198 iterated wake_rows (always []), so items would have been empty even with real data flowing. Fixed: endpoint now drives off completed_rows as the primary signal. * FE shape tightened to match real #197 emission: - Added: alert_id (real BE field, surfaces as a font-mono chip on each card with the first 12 chars of the alert UUID for /alerts cross-referencing) - Removed: title + detail (CC#2 speculation — not in real payload; operator-facing context comes from category + investigation_summary_text) * Pinned the alignment with multiple drift-guards: - test_endpoint_drives_off_completed_rows_not_wake — pins the BE iteration shape so a regression to wake_rows gets caught - test_alert_wake_consumer_emits_expected_payload_shape — walks kora_cli/alerts/wake_consumer.py + asserts every FE-rendered field has a corresponding BE-emitter source - test_real_197_payload_shape_renders_completely — exercises a synthetic-but-realistic payload through the endpoint - test_drill_down_supports_alert_session_id_prefix — verifies InvestigationDrillDown from #194 surfaces alert sessions via the existing _DRILL_DOWN_SUPPORTED_SEAMS allowlist - test_fe_dropped_speculative_title_detail_fields — pins the removal so a future refactor can't re-introduce them * SeamName Literal keeps alert.wake_requested as forward-compat for a future alert wake-emitter bucket (parallel to probe). Tests: 115 new + retained tests pass. Full kora_cli regression introduces zero new failures (76 vs 76 on base; pre-existing PTY / cron_profiles / panel_view inventory / model_switch / engine test failures confirmed identical on base via stash). Screenshots: web/docs/cockpit-nav-restructure-and-alert-viewer-verification/. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
8 tasks
rafe-walker
added a commit
that referenced
this pull request
May 24, 2026
…irst-run wizard + mobile sidebar polish (#205) Two deliverables — primary is the operator-onboarding wizard CC#2 flagged in #202 (paired with CC#1 NousResearch#431 per-tenant cost ladder + CC#3 NousResearch#430 Marvin runnable plugin for the pip-installable Kora bundle vision), secondary is the small mobile-sidebar follow-on from #202. A) KR-FE-OPERATOR-FIRST-RUN-WIZARD * 5-step wizard: Welcome+tenant / Anthropic / IsoKron+Slack / Tutorial probe / Promotion intro. First-run detection combines marker-file absence + audit-log emptiness → swaps "/" to render WizardPage instead of DashboardPage. * 6 BE endpoints, each ≤30 LoC of substantive logic: - GET /api/wizard/state (resume + first-run signal) - POST /api/wizard/validate-anthropic (1-token test inference) - POST /api/wizard/validate-substrate (PostgREST ping) - POST /api/wizard/validate-slack (auth.test) - POST /api/wizard/trigger-tutorial-probe (synthetic wake) - POST /api/wizard/complete (marker write + tenant_id persist) * Marker file at $KORA_HOME/wizard_config.json. Operator can re-open the wizard anytime at /wizard URL. * tenant_id wired through every step + the .env download + the tutorial probe — NOT hardcoded "default" — feeds CC#1 NousResearch#431's per-tenant cost-ladder foundation. * .env download flow: wizard NEVER mutates operator shell; surfaces downloadable .env operator copies to $KORA_HOME/.env then restarts Kora. Per the security posture: never modify operator env without explicit consent. * Validation badges (success / auth_failure / network_failure / timeout) render inline so operator knows immediately why a credential failed. * Drift-guards: _WIZARD_STEPS + _WIZARD_VALIDATION_RESULTS allowlists pinned across BE/FE/page. B) KR-FE-SIDEBAR-MOBILE-COLLAPSE-UX (small follow-on to #202) * Collapse-all / Expand-all shortcut at the top of the sidebar (mobile + desktop). Label flips with state (allCollapsed → "Expand all"; otherwise "Collapse all"). Tappable on the 375px mobile overlay. * useSidebarGroupCollapse hook extended with allCollapsed + setAll public surface methods backing the shortcut. * Badge overflow: formatBadgeCount caps display at "99+" so a long backlog can't break the narrow mobile chip. Numeric aria-label keeps the exact count for screen readers. Tests: 52 new tests covering wizard endpoints (5 state behaviours, 4 validation paths, tutorial-probe audit emission, complete-flow, 2 drift-guards + 5 FE source-pins) + sidebar overflow + collapse-all (5 pins). Full kora_cli regression: 0 new failures (76 vs 76 on base via stash — pre-existing PTY / cron / panel-view / engine failures unchanged). Screenshots: web/docs/operator-first-run-wizard-and-sidebar-mobile-ux/ (5 wizard steps + before/after mobile sidebar). Co-authored-by: CC#2 Kora Web <kora-pm@stormhavenenterprises.com> Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
10 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Two deliverables. Primary is the sidebar restructure CC#2 flagged in #198 (past 25 entries, hard to scan); secondary is the verification that AlertInvestigationsPage (built forward-compat in #198) actually renders correctly against real #197 alert payloads.
alert.wake_requested. Endpoint rewritten to drive offalert.investigation_completed(real primary signal). FE type tightened:alert_idadded, speculativetitle/detaildropped.Per-deliverable status
Deliverable A — Sidebar restructure ✅
useSidebarGroupCollapsehook persists per-group state tolocalStorage["kora.sidebar.groupCollapse.v1"]; operator overrides win over group defaults.SidebarNavGroupcomponent (keyboard-actionable:aria-expanded/aria-controls).badgeCount= sum of in-group items'badgeCount(operator sees "Promotion Loops 3" without expanding).Deliverable B — Alert viewer verification ✅
Type-assumption gaps found + fixed:
alert.wake_requestedseam exists → ✅ Reality: onlyalert.investigation_completedis emitted. Endpoint rewritten to iteratecompleted_rowsas the primary signal.title+detailfields → ✅ Reality: no such fields in payload. FE drops them; operator-facing context comes fromcategory+investigation_summary_text.alert_idfield → ✅ Added: surfaces as a font-mono chip on each card (first 12 chars of UUID) for cross-referencing the originating alert in /alerts.Drill-down verified for alert IDs:
_DRILL_DOWN_SUPPORTED_SEAMSincludesalert.investigation_completed(added in #198); FastAPI's{caller_session_id:path}accepts thealert:category:severityliteral. No BE changes needed — the drill-down endpoint already handles alert sessions.Empty state preserved: when window has no completion rows, page renders the calm "Kora hasn't been woken by alerts" empty state.
Drift-guard pin summary (8 new / extended)
SIDEBAR_GROUP_KEYS_IN_ORDERexportedtest_canonical_group_order_pinnedSIDEBAR_PATH_TO_GROUPexportedtest_no_orphan_pathsBUILTIN_NAV_RESTderived from groupstest_no_orphan_pathsflatMaps fromBUILTIN_NAV_GROUPS— can't drifttest_default_collapsed_groups_are_the_less_usedtest_sidebar_renders_grouped_not_flatsidebarNav.coreItems.mapremoved;sidebarGroups.mappresentcompleted_rowstest_endpoint_drives_off_completed_rows_not_waketest_alert_wake_consumer_emits_expected_payload_shapewake_consumer.py+ asserts every FE-rendered field has a BE emit-sourcetest_drill_down_supports_alert_session_id_prefix_DRILL_DOWN_SUPPORTED_SEAMSincludesalert.investigation_completed+ endpoint accepts path-style session idsSTOP-ASKs resolved inline
BUILTIN_NAV_RESTas a derived view (flatMap) for backward-compat withpartitionSidebarNav+ plugin-position insertion logic.alert_id. FE shape adjusted; BE endpoint rewritten; drift-guards pinned the new alignment._DRILL_DOWN_SUPPORTED_SEAMSalready includes the alert seams (added in feat(kora): KR-FE-PROMOTION-REVIEW-MULTI-LOOP-EXTEND-MEGABUCKET — 5 new card variants + alert investigations viewer #198); the endpoint matches any literalcaller_session_idsoalert:cost_ladder:criticaljoins without endpoint changes.Screenshots
All 3 in
web/docs/cockpit-nav-restructure-and-alert-viewer-verification/:sidebar_before.png— flat 43-entry sidebar (operator scans the whole list)sidebar_after.png— 9 groups; operator-priority surfaces expanded; daemon/settings/diagnostic collapsed; "Promotion Loops 3" badge sumalert_investigations_populated.png— 3 real-shape alert investigations rendering correctly (cost_ladder critical + webhook_dead_letter warning + reasoning_halted warning), each withid: <prefix>chip + drill linkTest plan
tsc -bcleanvite buildcleantests/kora_cli/regression: 0 new failures (76 vs 76 on base via stash)/alert-investigationspost-feat(kora): KR-ALERT-WAKE-AND-EMAIL-INTENT-PROMOTION-AND-ROUTER-LOOSEN-MEGABUCKET — 3 deliverables #197 → confirm real cards render with cost / model / DM status / alert_id chipRecommended next CC#2 dispatch
pip install korato a working cockpit faster (env vars, IsoKron auth, Slack DM channel ID, first probe wake). Single-deliverable bucket; pairs with the daemon migration work landing in parallel.🤖 Generated with Claude Code