Skip to content

Phase 7B: knowledge copilot reports UI#11

Merged
RobinOppenstam merged 1 commit into
mainfrom
feat/knowledge-copilot-reports-ui
May 28, 2026
Merged

Phase 7B: knowledge copilot reports UI#11
RobinOppenstam merged 1 commit into
mainfrom
feat/knowledge-copilot-reports-ui

Conversation

@RobinOppenstam

Copy link
Copy Markdown
Contributor

Summary

Builds the Phase 7B Knowledge Copilot + Reports UI on top of the Phase 7A APIs.

Changed files

  • src/app/(app)/copilot/* — live Knowledge Copilot route, loading/error states.
  • src/modules/knowledge/components/knowledge-copilot.tsx — role-aware prompt chips, ask form, answer metadata, citation badges/cards.
  • src/app/(app)/reports/* — report list/generation route plus detail route with loading/error/not-found states.
  • src/modules/reports/components/reports-console.tsx — report list, capability cards, generation form, generated report preview.
  • src/modules/reports/components/report-detail.tsx — report detail fetch/render using GET /api/reports/{id}.
  • src/modules/reports/components/report-markdown.tsx — safe markdown-as-structured-text renderer, no raw HTML injection.
  • src/lib/navigation.ts — moves Knowledge Copilot and Reports to live Phase 7 navigation.
  • src/app/(app)/incidents/[id]/page.tsx — adds low-risk incident entry points for Copilot and report generation.

Verification

  • npm install
  • npm run lint
  • npm run typecheck
  • npm test ✅ — 10 files passed, 50 tests passed, 5 skipped
  • npm run build
  • npm run cf:build
  • npm run demo:reset ⚠️ not available locally: DATABASE_URL is not configured
  • npm run knowledge:reports-smoke ⚠️ not run because local DB is unavailable (DATABASE_URL is not configured)

Route / visual review notes

Browser tooling was unavailable in this session: Clawdbot browser start failed with PortInUseError: Port 18801 is already in use; sandbox browser is disabled. I used route/API/static smoke instead.

Local route smoke with next dev:

  • /copilot?role=engineer → HTTP 200
  • /copilot?role=executive → HTTP 200
  • /reports?role=executive → HTTP 200
  • /reports?role=support-lead → HTTP 200
  • /reports?role=engineer → HTTP 200
  • /reports/report_flagship_exec_brief?role=executive → HTTP 200
  • /api/copilot?role=admin → HTTP 200 and returned all five demo prompts
  • /api/reports?role=executive → HTTP 500 locally due missing DATABASE_URL (expected local DB blocker)

No screenshots were captured because the browser tool could not start.

Acceptance checklist

  • Copilot page displays role-aware prompt suggestions and includes all five demo prompts for reviewer coverage.
  • Ask form is wired to POST /api/copilot.
  • Answer panel shows AI/fallback mode, retrieval metadata, matched prompt, attempts, and citation badges.
  • Expandable citation cards show title, label, source type, source name/type, URI, excerpt, version, document/snippet IDs.
  • Reports page lists seeded/generated reports from GET /api/reports.
  • Report generation form is wired to POST /api/reports for postmortem, executive-summary, and customer-impact.
  • Role capability states are explicit: executive can generate executive summary, support lead customer impact, ops/admin all, engineer/finance read-only.
  • Unauthorized role state states API authorization remains authoritative, not UI-only security.
  • Report detail route uses GET /api/reports/{id} and renders markdown safely as structured text, not raw HTML.
  • Report detail renders citation labels/IDs from metadata when present.
  • Navigation exposes Copilot + Reports as live Phase 7 areas.
  • Incident detail includes “Ask Copilot about this incident” and “Generate report” entry points.

Risks / notes

  • Local DB-backed smoke/manual generation was blocked by missing DATABASE_URL in this worktree.
  • Browser visual review was blocked by Clawdbot browser port conflict (PortInUseError: Port 18801 is already in use).
  • Known Cloudflare deploy/actions blocker is intentionally ignored per Robin instruction; local cf:build passes.

@RobinOppenstam RobinOppenstam force-pushed the feat/knowledge-copilot-reports-ui branch from e6ca293 to db2ba1d Compare May 28, 2026 07:59
@RobinOppenstam

Copy link
Copy Markdown
Contributor Author

[CommandGrid][Phase 07B][PR_OPEN] PR opened and ready for Scout review. Ralph, please start Scout review.

@RobinOppenstam RobinOppenstam merged commit cda5ad0 into main May 28, 2026
2 checks passed
@RobinOppenstam RobinOppenstam deleted the feat/knowledge-copilot-reports-ui branch May 28, 2026 08:25
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