This repository was archived by the owner on May 26, 2026. It is now read-only.
feat(kora): KR-FE-PROMOTION-REVIEW-MULTI-LOOP-EXTEND-MEGABUCKET — 5 new card variants + alert investigations viewer#198
Merged
rafe-walker merged 1 commit intoMay 24, 2026
Conversation
…ew card variants + alert investigations viewer
Two deliverables that close the FE side of the promotion-loops
product direction + add the cockpit surface for alert investigations.
A) KR-FE-PROMOTION-REVIEW-PANEL-EXTEND
* PromotionReviewPage extended from phrasebook-only to host 6
loop variants via LoopTypeTabs (Phrasebook / Router / Tools /
Envelopes / Snapshot / Email).
* Per-loop card variants render distinct payload shapes:
- PhrasebookCard: edit-before-approve + SnapshotPreview (preserved)
- RouterTuningCard: route + escalation_rate + tighten/loosen
recommendation chip
- ToolTrimmingCard: route + collapsible unused-tools list
- ProbeEnvelopeCard: HIGH-RISK red border + manual-scaffold
disclaimer + blast-radius summary
- SnapshotExpandCard: informational (audit-derived) with
AUTO-APPLY env-flag warning when on
- EmailIntentCard: forward-compat for CC#1's NousResearch#420 — renders
cleanly empty until the BE loop ships
* New BE endpoint GET /api/promotions/counts aggregates per-loop
pending counts in one round-trip; sidebar PendingBadge now
reflects all actionable loops (excludes snapshot_expand).
* New BE endpoint GET /api/promotions/snapshot-expand/recent
reads promotion.snapshot_field_added audit rows for the
read-only Snapshot card variant.
* Phrasebook /pending response gains loop_name field for
symmetric FE discrimination.
* Drift-guard: _PROMOTION_LOOP_TYPES (BE) ↔ PROMOTION_LOOP_NAMES
(FE) pinned by test_promotion_loop_types_drift_guard.
B) KR-FE-ALERT-INVESTIGATIONS-VIEWER (forward-compat for NousResearch#420)
* New BE endpoint GET /api/alert-investigations mirrors
/api/probe-investigations: joins alert.wake_requested +
alert.investigation_completed audit rows + slack_dm_log entries
by caller_session_id ``alert:{category}:{severity}``.
* Both alert seams added to SeamName Literal as forward-compat
so read_audit_entries doesn't ValidationError once NousResearch#420
starts emitting.
* _ALERT_DM_STATUS_VALUES alias to _DM_STATUS_VALUES — alert +
probe wakes share the same DM-dispatch path.
* New FE page /alert-investigations with empty-state framing for
the forward-compat case + populated layout (with autoaction
badge, dm_status filter chips, severity summary, drill links).
* KoraActionsPage extended with alert_investigation_completed
category — deep-links to /alert-investigations once seam fires.
* Drill-down allowlist extended with alert.wake_requested +
alert.investigation_completed.
Tests: 117 new + retained tests pass. Full kora_cli regression
introduces zero new failures (pre-existing PTY / cron_profiles /
panel_view inventory / model_switch failures confirmed identical
on base branch via stash).
Screenshots: web/docs/promotion-review-multi-loop-extend-megabucket/.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
16f36b9 to
4818d52
Compare
7 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 that close the FE side of the promotion-loops product direction + add the cockpit surface for alert investigations.
/api/promotions/countsaggregate endpoint feeds tab badge counts. New/api/promotions/snapshot-expand/recentreads the audit-derived snapshot-expand proposals (read-only, no approve flow).alert.wake_requested/alert.investigation_completed.Drift-guard pin summary (3 new)
_PROMOTION_LOOP_TYPES(BE) ↔PROMOTION_LOOP_NAMES(FE)test_promotion_loop_types_drift_guardPROMOTION_LOOP_SLUGS(FE map) ↔ BE endpoint pathstest_promotion_loop_slugs_match_loop_dirs/api/promotions/<slug>/pendingendpoint_ALERT_DM_STATUS_VALUESalias to_DM_STATUS_VALUEStest_alert_dm_status_drift_guardPlus:
_KORA_ACTION_CATEGORIESdrift-guard extended withalert_investigation_completedtest_seam_literal_includes_all_source_seamsextended withalert.investigation_completedtest_drill_down_allowlist_includes_alert_seamsensures the drill-down can surface alert seams once fix: respect OPENAI_BASE_URL when resolving API key priority NousResearch/hermes-agent#420 starts emittingPer-card visual summary
Card variants (all in
PromotionReviewPage.tsx):STOP-ASKs resolved inline
loop_namein the 3 newer loop responses; phrasebook didn't. Addedloop_name: "phrasebook"to the phrasebook response (1-line BE change) so FE has a uniform discriminator across all 6 loops. No new field on the proposal payloads themselves — discriminator lives at the response envelope./api/promotions/countsaggregate endpoint (one round-trip) instead of fanning out to 6/pendingreads. Pre-aggregation per-loop (list_pending/list_by_status) is fast enough; pagination not needed at today's volume./api/alert-investigationscleanly as forward-compat. Addedalert.wake_requested+alert.investigation_completedtoSeamNameLiteral soread_audit_entriesreturns[]instead of ValidationError until fix: respect OPENAI_BASE_URL when resolving API key priority NousResearch/hermes-agent#420 starts emitting. Page renders empty-state UX in the interim.border-destructive/60), "HIGH RISK" destructive badge, dedicated red-background blast-radius strip, yellow warning strip with "Approve does NOT mutate fix_envelopes.py", renamed approve button to "Approve (manual scaffold required)". Pinned bytest_high_risk_probe_envelope_visual_treatment. No explicit confirmation step in v1 — operator already has approve-with-notes affordance.Screenshots
All 3 in
web/docs/promotion-review-multi-loop-extend-megabucket/:promotion_review_multi_loop.png— Router tab active, showing RouterTuningCard + ToolTrimmingCard + HIGH-RISK ProbeEnvelopeCard + SnapshotExpandCard with AUTO-APPLY warningpromotion_review_phrasebook_email.png— PhrasebookCard with SnapshotPreview preserved + Email tab empty state + sample EmailIntentCard shape (forward-compat preview)alert_investigations.png— empty state today (pre-fix: respect OPENAI_BASE_URL when resolving API key priority NousResearch/hermes-agent#420) above + populated layout preview (cost_anomaly critical with auto-action + vercel_deploy_failure warning)Test plan
tsc -bcleanvite buildclean (1.9 MB bundle; no new warnings)tests/kora_cli/regression: 0 new failures introduced; pre-existing PTY / cron_profiles / panel_view inventory / model_switch failures confirmed identical on base via stash/promotions/phrasebook, switch tabs across all 6 loops, verify counts populate from/api/promotions/countsKORA_PROMOTE_SNAPSHOT_EXPAND_AUTO_APPLY=true, verify Snapshot tab shows AUTO-APPLY warning strip/alert-investigations, confirm empty state copy (pre-fix: respect OPENAI_BASE_URL when resolving API key priority NousResearch/hermes-agent#420)Recommended next CC#2 dispatch
Two candidates surfaced during this batch:
🤖 Generated with Claude Code