Skip to content

employee-profile 'latest outcome' read has no run-finalization check (same class as #491) #493

Description

@Taleef7

Found during the #491/#492 review sweep: backend-ts/src/run/employee-profile.ts uses listOutcomesForEmployee(externalId, 1) as "the latest outcome" (and the same scan at line ~127 for history). Like MCP check_compliance before #491 (and CDS before #470, the compliance API before #399), the newest row wins with no check that its run reached a terminal status — so the employee profile can render a mid-run partial result as the subject's current state, which silently becomes wrong if the run FAILs.

Lower stakes than the fixed surfaces (frontend operator view, not an AI client or a public contract), and the history listing arguably should show everything. But the "latest/current" cell is a latest-answer read and should come from listLatestFinalizedOutcomePerMeasure like the other three surfaces.

  • Switch the per-employee "current" read to the finalized-per-measure primitive
  • Decide whether the history view keeps raw rows (probably yes — it is a history, not an answer)

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions