Skip to content

Commit 2017162

Browse files
committed
new proposals
1 parent d1283ce commit 2017162

80 files changed

Lines changed: 2424 additions & 0 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
schema: spec-driven
2+
created: 2026-03-03
Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
## Context
2+
3+
AI source attribution exists, but actionable source navigation is missing in key UX paths. Visitors see source titles but cannot click through to relevant articles directly from AI responses.
4+
5+
## Goals / Non-Goals
6+
7+
**Goals:**
8+
- Provide clickable source links for article-backed AI responses.
9+
- Keep source attribution structured and consistent across widget and AI review surfaces.
10+
- Handle mixed source types gracefully.
11+
12+
**Non-Goals:**
13+
- Redesigning full help center UI navigation.
14+
- Changing AI retrieval/ranking logic in this change.
15+
16+
## Decisions
17+
18+
### 1) Enrich source metadata with linkable article identity
19+
20+
Decision:
21+
- Include link-ready metadata for article sources (for example article ID and navigable target) in stored AI response payloads.
22+
23+
Rationale:
24+
- Rendering layers need explicit data to build reliable links.
25+
26+
Alternatives considered:
27+
- Infer links from title text in UI. Rejected due to ambiguity and fragility.
28+
29+
### 2) Render source chips/links in widget message context
30+
31+
Decision:
32+
- Widget AI message component renders source links as clickable UI elements that route to article detail.
33+
34+
Rationale:
35+
- Improves self-service resolution directly inside conversation flow.
36+
37+
Alternatives considered:
38+
- Keep plain text only. Rejected due to poor UX and traceability.
39+
40+
### 3) Keep fallback handling for non-article sources
41+
42+
Decision:
43+
- Non-linkable sources remain labeled attribution entries without broken link affordances.
44+
45+
Rationale:
46+
- Maintains source transparency without invalid navigation.
47+
48+
## Risks / Trade-offs
49+
50+
- [Risk] Link targets could become stale if article records are removed.
51+
- Mitigation: resolve targets at render time and fallback to title-only entry when unavailable.
52+
- [Risk] Extra metadata may increase payload size.
53+
- Mitigation: keep source payload minimal and structured.
54+
55+
## Migration Plan
56+
57+
1. Extend source metadata schema and response serialization for linkable article fields.
58+
2. Update widget AI source rendering to show clickable article entries.
59+
3. Update AI review/chat source renderers to use linkable metadata.
60+
4. Add tests for link rendering and non-article fallback behavior.
61+
62+
Rollback:
63+
- Revert UI link rendering while preserving source metadata extension for future use.
64+
65+
## Open Questions
66+
67+
- Should source links include deep links for web inbox contexts in this same change?
68+
- Do we show per-source confidence/rank in UI now or later?
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
## Why
2+
3+
AI responses currently store source metadata as type/id/title, but widget chat only renders source titles as plain text and does not provide direct article navigation. This weakens answer traceability and makes self-serve follow-up harder for visitors.
4+
5+
## What Changes
6+
7+
- Extend AI response source metadata to include linkable Help Center reference data for article sources.
8+
- Render AI source references in widget chat as clickable article links that open corresponding articles.
9+
- Surface the same linkable source references in AI review/chat contexts where appropriate.
10+
- Preserve non-article source handling without broken links.
11+
12+
## Capabilities
13+
14+
### New Capabilities
15+
16+
- `ai-help-center-linked-sources`: AI responses expose linkable Help Center article sources in chat/review surfaces.
17+
18+
### Modified Capabilities
19+
20+
- None.
21+
22+
## Impact
23+
24+
- Convex AI response storage and query payload shape for sources.
25+
- Widget chat rendering of AI source references.
26+
- Inbox AI review/source presentation logic.
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
## ADDED Requirements
2+
3+
### Requirement: AI response source records MUST include linkable metadata for article sources
4+
5+
AI response source entries associated with Help Center articles SHALL include metadata required for reliable article navigation.
6+
7+
#### Scenario: AI response references published article
8+
9+
- **WHEN** AI response includes a Help Center article source
10+
- **THEN** source metadata SHALL include linkable article identity fields for UI navigation
11+
12+
### Requirement: Widget AI messages MUST render article sources as clickable links
13+
14+
Widget conversation UI SHALL render article-backed AI sources as clickable elements that open the corresponding article context.
15+
16+
#### Scenario: Visitor taps article source in AI message
17+
18+
- **WHEN** widget displays an AI message with article sources
19+
- **THEN** selecting a source SHALL open the referenced article view
20+
21+
### Requirement: Non-article sources MUST degrade gracefully
22+
23+
Sources without linkable article targets SHALL remain visible as attribution text and MUST NOT render broken links.
24+
25+
#### Scenario: AI response includes snippet source
26+
27+
- **WHEN** AI response includes a non-article source
28+
- **THEN** UI SHALL display source attribution without invalid navigation affordances
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
## 1. Source Metadata Extension
2+
3+
- [ ] 1.1 Extend AI response source payload shape with linkable article metadata fields.
4+
- [ ] 1.2 Update source serialization/query code to return enriched metadata.
5+
6+
## 2. UI Integration
7+
8+
- [ ] 2.1 Render clickable article source links in widget AI message UI.
9+
- [ ] 2.2 Update AI review/chat source rendering to use linkable metadata where available.
10+
11+
## 3. Verification
12+
13+
- [ ] 3.1 Add tests for article link rendering and navigation behavior.
14+
- [ ] 3.2 Add tests for non-article source fallback handling.
15+
16+
## 4. Cleanup
17+
18+
- [ ] 4.1 Remove ad-hoc source-title-only rendering paths where replaced.
19+
- [ ] 4.2 Document source metadata contract for AI and UI contributors.
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
schema: spec-driven
2+
created: 2026-03-03
Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
## Context
2+
3+
Support teams and visitors can communicate in different languages, but current AI and inbox flows do not provide translation mediation. A robust implementation needs translation transparency, language preference memory, and safe fallbacks when translation fails.
4+
5+
## Goals / Non-Goals
6+
7+
**Goals:**
8+
- Detect/store conversation language context.
9+
- Provide automatic translation for AI replies and optional agent-assisted replies.
10+
- Preserve original text for audit/review and quality checks.
11+
- Expose translation status in chat/review UI.
12+
13+
**Non-Goals:**
14+
- Building a standalone human translator management system.
15+
- Guaranteeing perfect translation quality for all languages.
16+
17+
## Decisions
18+
19+
### 1) Persist language metadata and dual-text payloads
20+
21+
Decision:
22+
- Store detected/source language plus translated output while retaining original message text.
23+
24+
Rationale:
25+
- Maintains transparency and enables quality review.
26+
27+
Alternatives considered:
28+
- Replace original message with translated-only text. Rejected due to audit and trust concerns.
29+
30+
### 2) Translation pipeline integrated at AI and agent reply boundaries
31+
32+
Decision:
33+
- Integrate translation in AI generation and agent send paths so visitors receive messages in conversation-preferred language.
34+
35+
Rationale:
36+
- Centralized translation boundary keeps UI clients simpler and consistent.
37+
38+
Alternatives considered:
39+
- Client-only translation. Rejected due to fragmentation and policy drift.
40+
41+
### 3) Safe fallbacks with explicit status
42+
43+
Decision:
44+
- If translation fails, preserve original delivery and mark translation status for review.
45+
46+
Rationale:
47+
- Avoids message loss and provides operational visibility.
48+
49+
## Risks / Trade-offs
50+
51+
- [Risk] Added latency from translation step.
52+
- Mitigation: async optimization and short-response caching where safe.
53+
- [Risk] Translation errors could misrepresent intent.
54+
- Mitigation: preserve original text and expose "view original" controls.
55+
- [Risk] Higher model/provider cost.
56+
- Mitigation: configurable language scope and threshold-based translation triggers.
57+
58+
## Migration Plan
59+
60+
1. Add schema fields for language metadata and translated/original content traces.
61+
2. Implement translation service integration for AI and agent reply flows.
62+
3. Add UI indicators/toggles for translation visibility.
63+
4. Add tests for language detection, translation success/fallback, and review visibility.
64+
5. Roll out behind workspace-level feature flag.
65+
66+
Rollback:
67+
- Disable feature flag and bypass translation step while retaining schema backward compatibility.
68+
69+
## Open Questions
70+
71+
- Which translation provider(s) are acceptable for initial rollout?
72+
- Should workspaces configure source/target language policy or rely on automatic detection only?
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
## Why
2+
3+
Current messaging and AI flows assume shared language context and do not provide automatic translation between visitors and support teams. This creates friction for multilingual conversations and limits self-serve AI usefulness across languages.
4+
5+
## What Changes
6+
7+
- Add conversation-level language detection and preference tracking for visitor interactions.
8+
- Introduce automatic translation support for AI responses and optional agent reply translation workflows.
9+
- Persist original and translated message forms so teams can review exact source text.
10+
- Add UI affordances to display translation status and allow viewing original content.
11+
12+
## Capabilities
13+
14+
### New Capabilities
15+
16+
- `ai-conversation-autotranslate`: Conversations can automatically translate between visitor language and support/AI language with traceable original text.
17+
18+
### Modified Capabilities
19+
20+
- None.
21+
22+
## Impact
23+
24+
- Convex messaging/AI pipelines and schema for language metadata and translation payloads.
25+
- Web inbox and widget/mobile messaging UI for translation display controls.
26+
- AI response generation flow and related analytics/review behavior.
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
## ADDED Requirements
2+
3+
### Requirement: Conversation flows MUST track language context for translation
4+
5+
Conversation messaging and AI workflows SHALL track detected/source language and preferred output language context.
6+
7+
#### Scenario: Visitor sends message in non-default language
8+
9+
- **WHEN** a visitor message is detected in a language different from workspace default
10+
- **THEN** conversation language context SHALL be updated with detected/source language metadata
11+
12+
### Requirement: AI and agent replies MUST support automatic delivery translation
13+
14+
AI responses and opted-in agent replies SHALL be translated to conversation-preferred visitor language while preserving original source text.
15+
16+
#### Scenario: AI responds in visitor-preferred language
17+
18+
- **WHEN** AI generates a response for a conversation with preferred language set
19+
- **THEN** delivered content SHALL be translated to the preferred language
20+
- **AND** original generated text SHALL remain available for review
21+
22+
#### Scenario: Agent sends translated reply
23+
24+
- **WHEN** an agent sends a reply with auto-translate enabled
25+
- **THEN** visitor-visible message SHALL be translated to the target language
26+
- **AND** original agent text SHALL be retained for audit/review
27+
28+
### Requirement: Translation failures MUST degrade safely with explicit status
29+
30+
If translation cannot be completed, message delivery SHALL continue with original text and explicit translation status metadata.
31+
32+
#### Scenario: Translation service fails
33+
34+
- **WHEN** translation provider returns an error or timeout
35+
- **THEN** original message text SHALL still be delivered
36+
- **AND** translation status SHALL indicate failure for operational review
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
## 1. Language Metadata Foundation
2+
3+
- [ ] 1.1 Define schema fields for conversation/message language metadata and original/translated text traces.
4+
- [ ] 1.2 Implement language detection and preferred-language persistence in conversation flows.
5+
6+
## 2. Translation Pipeline Integration
7+
8+
- [ ] 2.1 Integrate translation into AI response generation flow.
9+
- [ ] 2.2 Integrate optional translation into agent reply send path.
10+
- [ ] 2.3 Implement safe fallback behavior and status metadata on translation failure.
11+
12+
## 3. UI And Review Surfaces
13+
14+
- [ ] 3.1 Add translation status and original-text visibility controls in relevant chat/review surfaces.
15+
- [ ] 3.2 Add workspace-level feature flag/configuration controls for rollout.
16+
17+
## 4. Verification
18+
19+
- [ ] 4.1 Add tests for detection, translation success, and failure fallback flows.
20+
- [ ] 4.2 Run targeted web/widget/mobile/convex checks for touched translation paths.

0 commit comments

Comments
 (0)