Skip to content

Feature: Split overview dashboard from Process Sentinel workflows and add context Q&A #243

Description

@smithaldon1

Summary

Update the Workbench IA so / becomes a global overview dashboard outside the Process Sentinel workflow, while Process Sentinel gets its own workflow entry route.

The overview dashboard must include a full-width question field directly under the title. Users can ask about the current factory context, and v1 should return deterministic answers from existing FIP API data. Do not add an LLM, AI SDK, model gateway, RAG index, or external provider in this issue.

Related: #206, #232, #240

Public API / Interfaces

Add a read-only deterministic context question endpoint:

POST /context/questions

Request:

{
  "question": "What is the most important finding right now?"
}

Response:

{
  "question": "What is the most important finding right now?",
  "answer": "The current highest-priority finding is ...",
  "confidence": "supported",
  "sources": [
    {
      "type": "detection",
      "id": "det_fill_weight_gradual_drift",
      "label": "Fill weight gradual drift",
      "href": "/detections/det_fill_weight_gradual_drift"
    }
  ]
}

confidence values: supported, partial, unsupported.

Supported v1 question intents:

  • current site, area, line, asset, batch, work order, and product context
  • active detection count and highest-priority detection
  • why the primary detection was flagged, using evidence summaries
  • pending recommendation count and current recommendation status
  • API/source health summary from browser-safe data

Unsupported questions must return confidence: "unsupported" with a short answer and suggested example questions. Do not guess, call an LLM, query arbitrary data, expose secrets, or imply production readiness.

Implementation Changes

  • Keep / as the overview dashboard and move Process Sentinel workflow navigation under a new /process-sentinel entry point.
  • Update navigation so Overview is outside the Sentinel workflows group; workflow pages remain detection list, detection detail/evidence, recommendation review, and RCA/CAPA draft.
  • On /, place the full-width context question form directly below the dashboard title and above overview metrics.
  • Implement the question UI as a client component with accessible label text, submit/loading/error states, and an answer panel with cited links back into Workbench routes.
  • Add typed API client support for POST /context/questions.
  • Add backend deterministic intent matching in the API layer, using existing domain, Sentinel, event, recommendation, and connection/profile stores.
  • Update apps/web/README.md, docs/demo/OPERATIONS_WORKBENCH_INFORMATION_ARCHITECTURE.md, and docs/LEARNING_LOG.md.

Acceptance Criteria

  • / clearly reads as an overview dashboard, not a workflow step.
  • The context question field spans the dashboard content width and appears directly under the title.
  • Asking a supported question returns a deterministic answer with source references.
  • Unsupported questions fail safely with no hallucinated answer.
  • Overview remains read-only: no approve/reject/defer controls appear there.
  • Workflow pages still support the Process Sentinel path: detect, explain with evidence, review recommendation, draft RCA/CAPA.
  • Copy aligns with the Docker/external-source direction and avoids simulator-first wording where this issue touches UI text.

Test Plan

  • Backend tests for POST /context/questions: supported question, partial question, unsupported question, empty/invalid question, and source references.
  • Frontend unit/static tests for route presence, navigation grouping, API client type coverage, and overview Q&A UI strings.
  • Playwright smoke coverage for entering a question on /, receiving an answer, and following a cited detection/recommendation link.
  • Run:
    • make test
    • make lint
    • make typecheck
    • cd apps/web && npm test
    • cd apps/web && npm run lint
    • cd apps/web && npm run typecheck
    • make test-e2e

Assumptions

  • The selected scope is deterministic v1, not AI-backed natural language answers.
  • The endpoint answers only from current platform context and runtime state already exposed through browser-safe APIs.
  • AI-backed context Q&A should be planned later around the documented Local Model Gateway and Factory Memory direction.

Metadata

Metadata

Assignees

No one assigned

    Labels

    FeaturebackendBackend service workfrontendFrontend application workneeds-e2eNeeds end-to-end test coverageoperations-workbenchOperations Workbench web UI workprocess-sentinelProcess Sentinel detection workready-to-buildReady for contributor implementationui-uxUI/UX planning, writing, and interaction design work

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions