Skip to content

Studio memory: show the Proposal row on the fact detail (map sourceProposalId) #2223

Closed

Description

@peppescg

Parent: #2210. Follow-up to #1854 (PR #2222).

Outcome

The memory fact detail page shows the prototype's Proposal row, linking to the learning proposal that wrote the fact, when the revision has one. #2222 ships the fact detail without that row, as a recorded deviation; this issue closes the gap.

Why it was left out

The daemon already provides the field. UserModelRevision.source_proposal_id exists in contracts/proto/mecatl/v1/harness.proto (field 9) and in the SDK's UserModelRevision. Studio's BFF drops it:

  • apps/server/src/mecatl/knowledge.ts memoryRevisionFromSdk() maps sourceSessionId but not sourceProposalId.
  • apps/contracts/src/schemas/knowledge.ts memoryRevisionSchema has no sourceProposalId.

#2222 deliberately didn't touch the contract, to keep that PR UI-only.

Scope

  1. Add sourceProposalId: z.string() to memoryRevisionSchema (an empty string when unset, like sourceSessionId) and map it in memoryRevisionFromSdk(). Regenerate contracts with task studio:generate.
  2. In apps/web/src/features/memory/memory-fact-detail.tsx, render the prototype's row: label="Proposal", monospace, shown only when set, linking to the Learning settings section. Prototype reference: stacklok/mecatl-prototypes stack/08-tooling:apps/web/src/features/memory/memory-fact-detail.tsx. If Studio learning: proposal queue, evidence, and chat reflection #1855 lands a stable per-proposal route, link to the proposal itself rather than the section.
  3. Tests: an adapter/route test for the mapped field, and a detail-page test for the row being present and absent.

Acceptance

  • The fact detail shows the Proposal row when sourceProposalId is set, identical to the prototype, and nothing when it isn't.
  • Before/after screenshots (desktop and mobile, light and dark).
  • task studio:check and task studio:browser pass.

Metadata

Metadata

Assignees

No one assigned

    Labels

    WebUIenhancement

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions