ADR-AT03.1: AT03βAT04 Transition Plan¶
Transition strategy ADR defining the phased approach from minimal refactor (AT03) to comprehensive platform (AT04)
- Status: Proposed
- Type: Transition Strategy
- Date: 2025-12-12
- Owner: Aaron Solomon
- Author: Aaron Solomon, Claude Sonnet 4.5
- Parent ADR: ADR-AT03
- Related ADRs: ADR-AT04, ADR-TG01
Context¶
The Problem¶
tnh-gen CLI (ADR-TG01) requires robust ai_text_processing to function, but we face a timing dilemma:
- ADR-AT04 proposes comprehensive AI text processing platform (13-17 weeks implementation)
- tnh-gen is ready except for ai_text_processing dependency
- Blocking Issue: Making tnh-gen dependent on full AT04 creates 3-4 month release delay
The Question¶
How do we unblock tnh-gen without:
- Shipping with current brittle ai_text_processing (section boundary bugs, direct OpenAI calls)?
- Abandoning AT04's strategic vision (context propagation, strategy catalog, validation loops)?
- Creating throwaway work that must be rewritten for AT04?
Decision¶
Two-Phase Transition Strategy¶
Implement a phased approach that delivers incremental value:
Phase 1: AT03 Minimal Refactor β Unblock tnh-gen (1-2 weeks) Phase 2: AT04 Full Platform β Comprehensive capabilities (13-17 weeks, later)
Phase 1: ADR-AT03 - Minimal Viable Refactor (1-2 weeks)¶
Document: ADR-AT03
Scope (what we WILL implement):
- β Tier 0: TextObject/NumberedText robustness
validate_section_boundaries()- catches gaps/overlaps/out-of-boundsget_coverage_report()- debugging coverage statistics-
Fixed
merge_metadata()- correct metadata propagation -
β Tier 1: Minimal object-service patterns
- Simple error hierarchy (SectionBoundaryError, ProcessingError, PromptRenderError)
-
GenAIWrapperclass to isolate GenAI Service dependency -
β Tier 2: GenAI Service integration
- Remove all direct OpenAI SDK calls
- Route through GenAI Service for budget/rate limiting policies
-
Response fingerprinting for provenance tracking
-
β Tier 3: Basic prompt system adoption
- Migrate 3-5 key prompts to catalog (translation, sectioning, summarization)
- Use PromptsAdapter for rendering
- Add deprecation warning to
prompts.py
Scope Constraint (what we will NOT implement):
- β Task Orchestration Layer (AT04 Phase 1)
- β Context Propagation Graph (AT04 Phase 1)
- β Strategy Catalog & Polymorphism (AT04 Phase 2)
- β Validation Loops (AT04 Phase 3)
- β Experimentation Harness (AT04 Phase 4)
- β Cross-Document Coherence (AT04 Phase 5)
Timeline: 10-12 working days (4 phases Γ 3 days)
Success Criteria:
- tnh-gen CLI functional with prompt execution
- Section validation catches boundary errors
- No direct OpenAI SDK calls
- Structured errors map to tnh-gen CLI exit codes
- Unit tests pass for validation and GenAIWrapper
- Foundation ready for AT04
Phase 2: ADR-AT04 - Full Platform (13-17 weeks) - LATER¶
Document: ADR-AT04
Scope: Comprehensive platform for:
- Context-aware processing with propagation graph
- Strategy experimentation with catalog and polymorphism
- Evaluation-driven development with experimentation harness
- Cross-document coherence with shared terminology
Relationship to AT03: Builds on AT03's foundation (TextObject, GenAI, Prompts)
Timeline: Deferred pending tnh-gen release and validation spike
Why This Works¶
Strategic Advantages¶
- Unblocks tnh-gen: Release in 2 weeks instead of 4+ months
- No wasted work: AT03 establishes foundation AT04 requires
- De-risks AT04: Validate platform approach with working CLI first
- Incremental value: Users get tnh-gen sooner, platform capabilities later
- Clear migration path: AT04 proceeds without disrupting tnh-gen
Key Insight: AT03 as Phase 0.5 of AT04¶
AT03 is not a detourβit's the prerequisite foundation:
ADR-AT03 (Phase 0.5) β ADR-AT04 Full Platform
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β
TextObject robustness β Context Propagation Graph
β
GenAI Service integration β Task Orchestration Layer
β
Basic prompt adoption β Strategy Catalog & Polymorphism
β
Error handling β Validation Loops
β Experimentation Harness
β Cross-Document Coherence
What AT03 Provides for AT04:
- TextObject Robustness β Context Propagation can track section lineage accurately
- GenAI Service Integration β Task Orchestrator calls GenAI Service (no direct OpenAI)
- Prompt System Adoption β Strategy Catalog extends prompt catalog with strategy templates
- Error Handling β Validation Loops use same exception hierarchy
Implementation Plan¶
Week 1-2: AT03 Implementation¶
Phase 1: TextObject Robustness (Days 1-3)¶
- Add
validate_section_boundaries()toNumberedText - Add
get_coverage_report()for debugging - Fix
merge_metadata()bugs inTextObject - Unit tests for validation methods
- Deliverable: TextObject tests pass, section validation working
Phase 2: GenAI Service Integration (Days 4-6)¶
- Create
GenAIWrapperclass withrender_and_execute() - Add
exceptions.pywith error hierarchy - Create
factory.pywithcreate_genai_wrapper() - Update
line_translator.pyto use wrapper - Remove direct OpenAI imports
- Deliverable: No direct OpenAI SDK calls, provenance metadata captured
Phase 3: Prompt Migration (Days 7-9)¶
- Migrate 3-5 key prompts to catalog
- Update processors to use prompt keys
- Add deprecation warning to
prompts.py - Test prompt rendering with PromptsAdapter
- Deliverable: Key prompts loaded from catalog
Phase 4: Integration & Testing (Days 10-12)¶
- Integration tests for full workflows (sectioning β translation)
- Test tnh-gen CLI with refactored module
- Verify error handling maps to CLI exit codes
- Documentation updates (migration guide)
- Deliverable: tnh-gen CLI functional with robust ai_text_processing
Week 3+: tnh-gen Release¶
- Ship tnh-gen with robust ai_text_processing
- Gather user feedback on CLI experience
- Plan AT04 validation spike (Phase 0 from AT04 Β§4)
Months 2-6: AT04 Implementation (Optional)¶
Decision Point: After tnh-gen release, evaluate need for AT04 investment
If proceeding:
- Phase 0: Validation spike (1 week) - quantify cost/quality trade-offs
- Phase 1: Task Orchestration, Context Propagation (3-4 weeks)
- Phase 2: Strategy Catalog (2-3 weeks)
- Phase 3: Validation Loops (2 weeks)
- Phase 4: Experimentation Harness (2-3 weeks)
- Phase 5: Cross-Document Extensions (3-4 weeks)
Migration Timeline¶
NOW +2 weeks +3 weeks +6 months
β β β β
ββ AT03 Impl βββ€ β β
β ββ tnh-gen β β
β β Release β β
β β ββ Phase 0 β
β β β Validation β
β β ββ Phase 1-5 ββ€
β β β (AT04) β
β β β ββ Full Platform
Ready
Key Milestones:
- Week 2: AT03 complete, tnh-gen functional
- Week 3: tnh-gen released to users
- Week 4: AT04 validation spike (optional)
- Month 6: Full platform ready (if AT04 approved)
Decision Points¶
Immediate (Now)¶
- β Approve AT03 refactor as minimal viable approach
- β³ Begin implementation (10-12 days sprint)
- β Update AT04 with Phase 0.5 reference
After AT03 Complete (Week 2)¶
- Release tnh-gen: Ship CLI with robust ai_text_processing
- Gather feedback: User experience with CLI
- Document learnings: What worked, what needs improvement
After tnh-gen Release (Week 3+)¶
- Evaluate AT04 need: Is platform investment justified by usage?
- Run validation spike: Quantify cost/quality trade-offs for context strategies
- Decide on timeline: Proceed with full platform or defer to later
Consequences¶
Positive¶
- Fast tnh-gen release: 2 weeks vs 4+ months
- Foundation for AT04: No throwaway workβeverything feeds into platform
- Risk mitigation: Validate approach with real CLI before large platform investment
- User value: tnh-gen users get functionality sooner
- Clear path forward: AT04 can proceed when ready without disrupting CLI
Negative¶
- Minimal abstractions: AT03 avoids full object-service patterns (technical debt)
- Limited capabilities: No context propagation, strategy catalog, validation loops initially
- Future refactor: Some AT03 code will be enhanced (not replaced) for AT04
- Coordination overhead: Must track two parallel ADRs (AT03, AT04)
Risks & Mitigations¶
| Risk | Impact | Mitigation |
|---|---|---|
| AT03 scope creep | Delays tnh-gen release | Strict 10-12 day timeline; defer anything non-essential to AT04 |
| AT04 never happens | Platform vision unrealized | AT03 still provides value (robust TextObject, GenAI integration, prompts) |
| AT03βAT04 migration pain | Complex refactor later | AT03 builds foundation AT04 assumes; minimize breaking changes |
| User confusion | Two ai_text_processing "versions" | Clear documentation on AT03 as Phase 0.5; AT04 extends, not replaces |
Success Criteria¶
This transition plan succeeds if:
- AT03 ships on time: 10-12 working days
- tnh-gen releases: CLI functional with robust ai_text_processing
- No rework needed: AT03 foundation remains valid for AT04
- User satisfaction: tnh-gen users report positive CLI experience
- AT04 path clear: Validation spike runs successfully; platform approach validated
- Team alignment: Clear understanding of phased approach; no confusion about goals
Files Updated¶
This transition plan coordinates:
- β ADR-AT03 - Refactored as minimal viable implementation
- β ADR-AT04 - Updated "Migration from AT03" section
- β This transition plan (ADR-AT03.1)
Next Steps¶
Immediate Actions¶
- Review & approve ADR-AT03.1 (this doc)
- Plan sprint: 10-12 day implementation schedule
- Assign work: Tiers 0-3 to team members
- Set up tracking: Deliverables checklist for each phase
- Begin Tier 0: TextObject robustness implementation
Follow-Up Actions (After AT03)¶
- Release tnh-gen: Announce CLI availability
- Gather feedback: User testing, bug reports
- Evaluate AT04: Decision on platform investment
- Plan validation spike: If proceeding with AT04
Approval Path: Architecture review β Sprint planning β Implementation β tnh-gen Release
This transition strategy enables pragmatic tnh-gen release while preserving AT04's strategic platform vision.