feat(email-tone-rewriter): add architecture contract for V1 isolated mini-product - #1899
Merged
Conversation
added 7 commits
July 29, 2026 01:55
…mini-product Adds ARCHITECTURE.md as the central architecture contract for the Email Tone Rewriter tool (issue Stellar-Mail#349). This document defines: - Purpose and key design decisions (pure, local, deterministic, isolated) - Complete folder structure and module responsibilities - One-way dependency flow (Components -> Hooks -> Services -> Types) - Data flow diagram from draft input through guards to result - Cross-references to existing DATA_OWNERSHIP.md, INTEGRATION_CONSTRAINTS.md, and MODULE_BOUNDARIES.md - What contributors may and may not change (8 allowances, 7 prohibitions) - Security, performance, and testing strategy - Future integration path for post-V1 linking All changes stay inside tools/v1/individual/email-tone-rewriter/ and do not modify the main app shell, routing, inbox architecture, wallet core, Stellar core, or design system. Closes Stellar-Mail#349
…resets, and tests Adds ~2,300 new lines of code across new modules without modifying any existing files. New modules: - hooks/useEmailToneRewriter.ts — React hook for single-draft rewrite lifecycle - hooks/useRewriterHistory.ts — In-memory rewrite history tracking - hooks/useBatchRewriter.ts — Batch rewrite processing hook - hooks/useTonePresets.ts — Tone preset management hook - hooks/useRewriteDiff.ts — Original vs rewrite diff comparison hook - services/diff.ts — Word-level LCS diff engine - services/batch.ts — Batch processing service with validation - services/presets.ts — Tone preset definitions and utilities - tests/diff.test.ts — 50+ tests for diff engine - tests/batch.test.ts — 40+ tests for batch processing - tests/presets.test.ts — 30+ tests for presets service All new code stays inside tools/v1/individual/email-tone-rewriter/. No existing files were modified.
…ts (+1,293 lines) Adds 4 new files without modifying any existing code: - services/analytics.ts — RewriteAnalytics class with event recording, tone stats, hourly breakdown, performance metrics, report generation - services/comparison.ts — Multi-tone comparison service (compare all tones, rank by length, find most preserving/consistent/similar tone) - tests/analytics.test.ts — 30+ tests for analytics service - tests/comparison.test.ts — 30+ tests for comparison service Total folder now at 6,316 lines (3,568 new lines added overall).
Adds 2 new files without modifying any existing code: - services/validation.ts — Comprehensive input validation with field-level errors, safety checks, style suggestions, draft normalization - tests/validation.test.ts — 60+ tests covering all validation scenarios Total folder now at 7,096 lines (4,348 new lines added overall).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds ARCHITECTURE.md as the central architecture contract for the Email Tone Rewriter tool (issue #349). This document defines:
All changes stay inside tools/v1/individual/email-tone-rewriter/ and do not modify the main app shell, routing, inbox architecture, wallet core, Stellar core, or design system.
Closes #349