feat(confidence-engine): present completed results as coherent provenance narrative

When a reopened completed turn is displayed, distinguish it from an active question:

- 'PREVIOUSLY ANSWERED' + 'YOUR RESPONSE' headings for completed turns (hasAnswer=true)
- Bare 'QUESTION' heading preserved for active follow-ups (answer=null)
- Verbatim user answer rendered under its own heading — never conflated with Engine-derived findings
- Causal narrative: Question → Your response → What this tells us

Gate results:
- 102 tests passed (78 existing + 24 new v0.49 provenance narrative tests)
- Clean production build
- Live verification on localhost:3000 confirmed correct rendering
This commit is contained in:
2026-08-29 18:45:55 +01:00
parent 50a66749ae
commit 890a18c5a7
3 changed files with 209 additions and 1 deletions
+14 -1
View File
@@ -175,7 +175,20 @@ function FocusedQuestionBody({
{isFocused && hasContent && (
<div className="mt-4 space-y-4">
<div className="space-y-4 rounded-lg border border-gray-200 bg-white p-5">
{focused?.question?.trim() ? (
{hasAnswer && focused?.question?.trim() ? (
<div className="space-y-3">
{/* Previously answered question */}
<div>
<h3 className="mb-1 text-[11px] font-semibold tracking-widest uppercase text-gray-500">Previously answered</h3>
<p className="text-base font-medium leading-relaxed text-gray-900">{focused.question}</p>
</div>
{/* User's verbatim response — distinct provenance from Engine-derived content */}
<div>
<h3 className="mb-1 text-[11px] font-semibold tracking-widest uppercase text-gray-500">Your response</h3>
<p className="text-sm leading-relaxed text-gray-800">{focused.answer}</p>
</div>
</div>
) : focused?.question?.trim() ? (
<div>
<h3 className="mb-1 text-[11px] font-semibold tracking-widest uppercase text-gray-500">Question</h3>
<p className="text-base font-medium leading-relaxed text-gray-900">{focused.question}</p>