fix(triage): single follow-up preamble + chip-matching category labels (PP-4847)#1317
Conversation
…abels (PP-4847)
Two cosmetic defects from a regression sim-drive:
1. Doubled preamble. The reducer always prepends "Before I file this — " to the
escalation follow-up, but 3 of 7 corpus prompts carried their OWN preamble
("Before I send this to support —", "Quick question before I file this —",
"Before I escalate —"), so the patron saw two. Standardize: the reducer owns
the single canonical preamble; the corpus prompts are now bare questions.
A new corpus lint (EscalationPreambleTests) loads the shipped catalog and
fails if any prompt reintroduces a self-preamble.
2. Category label mismatch. The ticket-preview "Category" rendered
draft.category.rawValue.capitalized → "Signin" (no space) and surfaced the
internal `reader` case as "Reader", neither matching the chip the patron
tapped. Add KBCategory.displayName (audiobook→Audiobook, reader→Reading,
signin→Sign in, …) and route BOTH the preview and the chips through it, so
the two can never drift again.
Verified: TriageBotCore 22/22 green (new KBCategoryDisplayNameTests +
EscalationPreambleTests); catalog.json re-validated. UI label wiring
(#if canImport(UIKit)) is exercised by the iOS build in CI.
**Scope:** category display label + the follow-up preamble wording/corpus only.
**Not done:** PP-4846 (intermittent stuck-Send race) — separate branch,
repro-first.
**Deferred:** none.
🏗️ CodeAtlas Ledger Analysis✅ All Checks Passed♿ Accessibility (via AccessLint)
✅ No accessibility issues detected 🧪 Test Coverage (via QAAtlas)
🏛️ Architecture Analysis
🔍 Reachability Analysis
✅ No dead code detected 📊 0 files analyzed | 📦 Download Full Report Powered by CodeAtlas Ledger |
🧪 Unit Test Results📊 View Full Interactive Report ❌ 1 TEST FAILED7874 tests | 7741 passed | 1 failed | 130 skipped | ⏱️ 13m 29s | 📊 98.3% | 📈 45.7% coverage Tests by Class — 902 classes, 1 with failures
Failed Tests (click to expand)📊 Testing Coverage BreakdownUnit Test Line Coverage (testable surfaces): 45.7% Total coverage incl. UI/lifecycle: 44.7% (17 files excluded from testable denominator — see
🔗 Interactive HTML Report | CI Run Details 📦 Downloadable Artifacts
|
Two cosmetic triage-bot defects from a regression sim-drive.
1. Doubled "before I file" preamble
The reducer always prepends
Before I file this —to the escalation follow-up question, but 3 of 7 corpus prompts carried their own preamble (Before I send this to support —,Quick question before I file this —,Before I escalate —) → the patron saw two.Fix: standardize — the reducer owns the single canonical preamble; the 3 corpus prompts are now bare questions. A new corpus lint (
EscalationPreambleTests) loads the shipped catalog and fails if any prompt reintroduces a self-preamble.2. Category label mismatch
The ticket-preview "Category" field rendered
draft.category.rawValue.capitalized→ "Signin" (no space) and surfaced the internalreadercase as "Reader", neither matching the chip the patron tapped ("Sign in", "Reading").Fix: add
KBCategory.displayNameand route both the ticket preview and the category chips through it — one source of truth, so chip and preview can't drift again.Verification
TriageBotCore 22/22 green (new
KBCategoryDisplayNameTests+EscalationPreambleTests, including the reducer single-preamble assertion and the real-catalog lint).catalog.jsonre-validated as JSON. The UI label wiring (#if canImport(UIKit)) is exercised by CI's iOS build.No
rawValue/ telemetry-key changes; no redaction/send-consent/submission changes.