[P1] U02: Complete React streaming chat, authorized sources and feedback controls #29

Open
opened 2026-10-21 20:29:30 +02:00 by amiryahaya · 0 comments
Owner

Backlog ID: U02 | Priority: P1 | Phase: M5 — Local inference and complete chat

Outcome and scope

Connect the authenticated workspace to typed streaming turns, contextual follow-up, source-span inspection and helpful/not-helpful feedback.

Dependencies and gates

Engineering prerequisites: #16 (U01), #27 (H02), #28 (H03)

Synthetic-data development may proceed. Production use remains subject to the decision gates in the SRS.

Starting points

web/src/chat/; web/src/sources/; web/src/feedback/; web/src/api/; web/tests/

These are current files or proposed responsibility boundaries; finalize a focused implementation plan before coding. Existing local scaffolding is uncommitted and is not evidence of completion.

Acceptance criteria

  • Tokens, loading, cancellation, overload, error, reconnect and completion states follow server events and stable message IDs.
  • Sources display only permitted title/version/page/section/excerpt and resolve through policy-checked endpoints; generated text and evidence are visually distinct.
  • Revocation/session expiry clears unavailable transcript/source state; follow-up sends conversation ID plus new input and leaves history selection to the server.
  • Accessible keyboard controls and English/Malay/mixed content render correctly; feedback binds to the completed answer and shows save/error state.
  • Browser submit/first generated token render timestamps support TTFT measurement; untrusted model/document text cannot execute scripts.

Verification

Browser end-to-end tests exercise ask/reopen/follow-up/cancel/source/feedback, stream errors, revoked sources, malicious rendered text, language variants and logout cleanup.

Behavior changes follow Red → Green → Refactor. Run affected Rust shared contract/unit tests and real PostgreSQL/Qdrant/runtime integration tests where applicable; frontend changes run typecheck/build and the relevant browser tests. Record exact commands/results in the implementation PR. Documentation/decision tasks use recorded review evidence.

Requirements and design

FR-UX-001–008, FR-RAG-009; NFR-I18N-001; architecture §9.4

Sources: SRS, system design. Local planning context: docs/implementation-plan.md and docs/development-backlog.md (not published by this task).

Security impact: Use synthetic fixtures until approved for operational data. Preserve current authorization, markings, provenance and default-deny behavior; exclude protected payloads/secrets from operational telemetry. No classified-deployment or PQC-compliance claim is implied by closing this issue.

Parent roadmap: #1

**Backlog ID:** U02 | **Priority:** P1 | **Phase:** M5 — Local inference and complete chat ## Outcome and scope Connect the authenticated workspace to typed streaming turns, contextual follow-up, source-span inspection and helpful/not-helpful feedback. ## Dependencies and gates **Engineering prerequisites:** #16 (U01), #27 (H02), #28 (H03) Synthetic-data development may proceed. Production use remains subject to the decision gates in the SRS. ## Starting points web/src/chat/; web/src/sources/; web/src/feedback/; web/src/api/; web/tests/ These are current files or proposed responsibility boundaries; finalize a focused implementation plan before coding. Existing local scaffolding is uncommitted and is not evidence of completion. ## Acceptance criteria - [ ] Tokens, loading, cancellation, overload, error, reconnect and completion states follow server events and stable message IDs. - [ ] Sources display only permitted title/version/page/section/excerpt and resolve through policy-checked endpoints; generated text and evidence are visually distinct. - [ ] Revocation/session expiry clears unavailable transcript/source state; follow-up sends conversation ID plus new input and leaves history selection to the server. - [ ] Accessible keyboard controls and English/Malay/mixed content render correctly; feedback binds to the completed answer and shows save/error state. - [ ] Browser submit/first generated token render timestamps support TTFT measurement; untrusted model/document text cannot execute scripts. ## Verification Browser end-to-end tests exercise ask/reopen/follow-up/cancel/source/feedback, stream errors, revoked sources, malicious rendered text, language variants and logout cleanup. Behavior changes follow Red → Green → Refactor. Run affected Rust shared contract/unit tests and real PostgreSQL/Qdrant/runtime integration tests where applicable; frontend changes run typecheck/build and the relevant browser tests. Record exact commands/results in the implementation PR. Documentation/decision tasks use recorded review evidence. ## Requirements and design FR-UX-001–008, FR-RAG-009; NFR-I18N-001; architecture §9.4 Sources: [SRS](https://forgejo.primatekun.tech/primatekuntech/rag-rust/src/branch/main/docs/SRS.md), [system design](https://forgejo.primatekun.tech/primatekuntech/rag-rust/src/branch/main/docs/architecture.md). Local planning context: `docs/implementation-plan.md` and `docs/development-backlog.md` (not published by this task). **Security impact:** Use synthetic fixtures until approved for operational data. Preserve current authorization, markings, provenance and default-deny behavior; exclude protected payloads/secrets from operational telemetry. No classified-deployment or PQC-compliance claim is implied by closing this issue. **Parent roadmap:** #1
Sign in to join this conversation.
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
primatekuntech/rag-rust#29
No description provided.