refactor(channels): share reset message construction across adapters

This commit is contained in:
William Valentin
2026-02-15 22:26:44 -08:00
parent 46538e71a8
commit 393aaf2743
7 changed files with 74 additions and 23 deletions
@@ -268,6 +268,7 @@ Remediation update (2026-02-16):
Remediation update (2026-02-16):
- Added shared `normalizeResetCommandText()` utility and migrated Discord/Slack/WhatsApp adapters to use it, reducing repeated reset-command parsing logic.
- Added shared `buildResetInboundMessage()` utility and migrated Discord/Slack/WhatsApp adapters to use it, reducing repeated reset-metadata construction logic.
### F-014 Low: ModelRouter listener API has destructive setter footgun
+2 -2
View File
@@ -2618,7 +2618,7 @@
"status": "in_progress",
"date": "2026-02-16",
"updated": "2026-02-16",
"summary": "Started reducing channel adapter duplication by extracting shared reset-command normalization and migrating Discord/Slack/WhatsApp adapters to use it.",
"summary": "Started reducing channel adapter duplication by extracting shared reset-command normalization and reset message construction utilities, and migrating Discord/Slack/WhatsApp adapters to use them.",
"files_modified": [
"src/channels/utils.ts",
"src/channels/utils.test.ts",
@@ -2627,7 +2627,7 @@
"src/channels/whatsapp/adapter.ts",
"docs/plans/analysis/2026-02-16-codebase-audit-report.md"
],
"test_status": "pnpm test:run src/channels/utils.test.ts src/channels/discord/adapter.test.ts src/channels/slack/adapter.test.ts src/channels/whatsapp/adapter.test.ts + pnpm typecheck passing"
"test_status": "pnpm test:run src/channels/utils.test.ts src/channels/discord/adapter.test.ts src/channels/slack/adapter.test.ts src/channels/whatsapp/adapter.test.ts + pnpm typecheck + pnpm lint passing"
},
"audit-followup-lint-error-baseline": {
"status": "completed",