This repository was archived by the owner on May 26, 2026. It is now read-only.
feat(kora): KR-FE-PROMOTION-PREVIEW-AND-INVESTIGATION-DRILL-AND-LOGGED-ONLY-MEGABUCKET — 3 deliverables#194
Merged
Conversation
…D-ONLY-MEGABUCKET — 3 deliverables Three operator-trust + decision-support FE features that together raise the cockpit's "Kora is a teammate, not a black box" quality. A) KR-FE-PROMOTION-PREVIEW (CC#2's own #191 recommendation) * New BE endpoint POST /api/phrasebook/slack_dm/preview-template accepts an arbitrary reply_template + returns rendered output against the LIVE snapshot, missing-field list, fall-through reason, snapshot freshness timestamp. * SnapshotPreview component in PromotionReviewPage's ProposalCard renders the live preview in both view + edit modes; 300ms debounce re-renders as operator edits the template. * Green chip "✓ all placeholders interpolate cleanly" / Yellow warning "would fall through to reasoning engine — N placeholders missing or 'unknown'" with the exact field list. B) KR-FE-EMAIL-LOGGED-ONLY-ANALYZER (CC#1 PR #180 follow-on, task NousResearch#400) * New page /email-intent-log/logged-only filtering intent.email_to_sea_ticket → action="logged_only" client-side. * Why-this-view explainer card framing the page as both a triage surface (Kora missed something) AND training-data lens for the eventual KR-PROMOTE-EMAIL-INTENT loop. * "Suggest pattern" CTA stubbed disabled-with-tooltip — operator sees the surface coming without implying it's wired (flagged in PR + STOP-ASK as future bucket KR-FE-PATTERN-SUGGESTION). * No new BE endpoint — reuses /api/email-intent/recent. C) KR-FE-INVESTIGATION-DRILL-DOWN * New BE endpoint GET /api/investigations/{caller_session_id:path} joins EVERY audit row + slack_dm_log entry sharing the session id into one oldest-first chronological timeline. Per-seam projections reuse existing per-seam panel helpers for privacy parity. Allowlist (_DRILL_DOWN_SUPPORTED_SEAMS) gates which seams can surface — drift-guarded against SeamName Literal. * New page /investigations/:callerSessionId with per-row card, per-seam icon, deep-link to per-seam panel, expandable raw-JSON toggle. * Deep-links wired from KoraActionsPage rows + ProbeInvestigations cards (Search-icon "drill" chip next to each caller_session_id). * Kind classifier (probe / email / promotion / other) drives the page header icon + title. Drift-guard pin: _DRILL_DOWN_SUPPORTED_SEAMS ↔ SeamName Literal, pinned by test_supported_seams_drift_guard so a "supported" seam that's not in SeamName (== returns []) is caught at CI. Tests: 28 new tests (preview endpoint behaviour matrix + drill-down JOIN + session-id classifier + drift-guards + FE page pins). Full kora_cli suite: my changes introduce zero new failures; pre-existing failures (cron_profiles + model_switch + panel_view inventory snapshot) confirmed identical on base branch via stash. Screenshots: web/docs/promotion-preview-and-investigation-drill-and-logged-only-megabucket/. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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
Three operator-trust + decision-support FE features that together raise the cockpit's "Kora is a teammate, not a black box" quality.
/email-intent-log/logged-onlysurfacing un-acted-on intent emails as triage + training-data lens. Reuses/api/email-intent/recent; no new BE endpoint.GET /api/investigations/{caller_session_id:path}joins EVERY audit row + slack_dm_log entry sharing the session id into one chronological timeline. Page deep-linked from KoraActionsPage rows + ProbeInvestigationsPage cards.Drift-guard pin summary
_DRILL_DOWN_SUPPORTED_SEAMS↔SeamNameLiteraltest_supported_seams_drift_guardSeamName(otherwiseread_audit_entriessilently returns[]for it)test_preview_response_type_declared+ the page wiring testsrendered_reply,rendered_with_missing_markers,referenced_fields,missing_or_degraded_fields,would_fall_through_to_reasoning_engine,snapshot_present,snapshot_computed_at) declared inPhrasebookPreviewTemplateResponsetest_kora_actions_row_links_to_drill_down+test_probe_investigations_card_links_to_drill_down/investigations/${encodeURIComponent(item.caller_session_id)}appears in both source pages — a route rename breaks both deep-link entries together rather than silently rotting oneNo FE/BE enum value drift introduced (the 3 deliverables are shape/route/path additions, not new enum constants).
STOP-ASKs resolved inline
Snapshot-preview rendering needs a new endpoint shape (§4 bullet 1) — built
POST /api/phrasebook/slack_dm/preview-templateaccepting just the template, returning render + missing-field list + freshness timestamp. ~75 LoC; reuses_walk_snapshot+_extract_phrasebook_snapshot_refsfrom existing code.Drill-down JOIN performance at realistic audit volume (§4 bullet 2) — each per-seam read scans the audit JSONL once; total cost is
O(file_size × supported_seam_count). At today's audit volume (low-MB files, ~10 supported seams) this is fast enough that pagination would be premature. Endpoint deliberately doesn't paginate; if file size grows past ~50 MB we'll revisit with a cursor."Suggest pattern" UI affordance (§4 bullet 3) — rendered disabled-with-tooltip explaining
KR-FE-PATTERN-SUGGESTIONis the follow-on. Operator sees the surface coming; no functionality implied that isn't there. Drift-guard testtest_suggest_pattern_stub_is_disabledkeeps it that way.Screenshots
All 3 in
web/docs/promotion-preview-and-investigation-drill-and-logged-only-megabucket/:promotion_preview.png— Deliverable A: two proposals, one with clean interpolation (green), one with missing-field warning (yellow + named fields)logged_only_analyzer.png— Deliverable B: explainer card + 3 logged-only events with disabled "Suggest pattern" stubinvestigation_drill_down.png— Deliverable C: full 5-event timeline (wake → tool_call → autofix → completed → DM) forprobe:fly:service_unhealthyTest plan
tsc -bcleanvite buildclean (1.9 MB bundle; no new warnings)tests/kora_cli/regression run: 0 new failures introduced; pre-existing failures (cron_profiles + model_switch + panel_view inventory snapshot of 34) confirmed identical on base via stash/email-intent-log/logged-only→ see un-acted-on events; "Suggest pattern" tooltip explains forward-compatNext CC#2 dispatch
Extend PromotionReviewPage to support the 3 new promotion-loop types (router-tuning / tool-trimming / probe-fix-envelopes) once CC#1's NousResearch#416 lands. The current ProposalCard assumes phrasebook-shaped fields (pattern + reply_template); the new loop types will need shape-discrimination + per-type editor variants. SnapshotPreview can stay phrasebook-only or fan out if any new type proves snapshot-bound.
🤖 Generated with Claude Code