Skip to content

feat(email-tone-rewriter): add architecture contract for V1 isolated mini-product - #1899

Merged
kryputh merged 7 commits into
Stellar-Mail:mainfrom
gelluisaac:feat
Jul 29, 2026
Merged

feat(email-tone-rewriter): add architecture contract for V1 isolated mini-product#1899
kryputh merged 7 commits into
Stellar-Mail:mainfrom
gelluisaac:feat

Conversation

@gelluisaac

Copy link
Copy Markdown
Contributor

Adds ARCHITECTURE.md as the central architecture contract for the Email Tone Rewriter tool (issue #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 #349

aetheron06 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).
@kryputh
kryputh merged commit 7c9b825 into Stellar-Mail:main Jul 29, 2026
5 checks passed
@gelluisaac
gelluisaac deleted the feat branch July 29, 2026 08:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[V1][individual] Email Tone Rewriter - Architecture and folder contract

2 participants