Skip to content

v0.4.3

Choose a tag to compare

@mmcky mmcky released this 18 Oct 01:18
· 369 commits to main since this release

Release v0.4.3 - Subsection Support Complete

Release Date: October 18, 2025
Status: Production-Ready ✅
Focus: Complete subsection handling with comprehensive testing


Overview

v0.4.3 completes the subsection support feature initiated in v0.4.0. This release fixes the final critical bug (subsection duplication) and includes comprehensive regression testing to ensure all subsection-related functionality works correctly.

Key Achievement: Subsections (### Subsection) are now fully supported - parsed from translated content, integrated into heading-maps, and reconstructed without duplication.


What's New

🐛 Bug Fixes

Subsection Duplication Bug (Critical)

Problem: Subsections were being duplicated when processing documents multiple times.

Root Cause: In extractSectionsWithSubsections(), the subsections array was being referenced rather than cloned, causing mutations to affect the original data.

Solution:

// Before (buggy)
section.subsections = subsections;

// After (fixed)
section.subsections = subsections.map(sub => ({ ...sub }));

Impact: Documents now reconstruct correctly with no duplication, even when processed multiple times.

✅ Testing

New Regression Tests: 10 tests added (87 total, all passing)

Test Suite 2: Document Reconstruction (5 tests)

  • Should parse subsections from translated content
  • Should handle sections with no subsections
  • Should handle empty translated content
  • Should extract correct subsection headings and content
  • Should not duplicate subsections when processing multiple times ⭐ (regression test)

Test Suite 3: Heading-Map Integration (5 tests)

  • Should include subsections in heading-map
  • Should handle sections without subsections in heading-map
  • Should handle mixed sections (some with/without subsections)
  • Should preserve subsection order in heading-map
  • Should update heading-map with subsections from translated content

Coverage: All subsection functionality thoroughly tested with realistic scenarios.


Complete v0.4.x Series

The v0.4.x series was a focused effort to add full subsection support:

v0.4.0 (November 2024)

  • Discovery: Heading-map incomplete - missing subsections
  • Analysis: Subsections not being extracted from translated content
  • Feature: Heading-map system with automatic population

v0.4.1 (December 2024)

  • Implementation: parseTranslatedSubsections() function
  • Feature: Extract subsections from translated section content
  • Issue: Subsections not appearing in heading-map

v0.4.2 (December 2024)

  • Fix: Recursive processing in updateHeadingMap()
  • Feature: Subsections now added to heading-map
  • Issue: Subsections duplicated in output

v0.4.3 (October 2025) ✅

  • Fix: Deep clone subsections to prevent duplication
  • Testing: 10 comprehensive regression tests
  • Result: Subsection support complete and production-ready

Technical Details

Architecture Changes

No breaking changes - all improvements are internal bug fixes.

Modified Functions:

  1. extractSectionsWithSubsections() - Deep clone subsections array
  2. Test suite - Added 10 regression tests

Heading-Map Behavior:

  • Now correctly contains 15 entries (10 sections + 5 subsections)
  • Previously only had 10 entries (sections only)
  • Maintains flat structure for all headings

Performance Impact

No performance changes - the deep clone operation is negligible (typically 5 subsections per section).


Validation Results

Test Repository Validation

Test Document: lectures/example.md

  • Sections: 10 (## Section)
  • Subsections: 5 (### Subsection)
  • Heading-Map Entries: 15 ✅
  • Duplication: None ✅
  • Processing: Multiple runs produce identical output ✅

Real-World Testing

Status: Ready for production use with QuantEcon lecture repositories

  • All core features working
  • No known bugs
  • Comprehensive test coverage

Migration Guide

Upgrading from v0.3.0 or earlier

No changes required - v0.4.3 is fully backward compatible.

Your existing workflow will automatically benefit from:

  • Subsections now tracked in heading-maps
  • More accurate cross-language section matching
  • No duplication issues

Upgrading from v0.4.0-v0.4.2

No changes required - bug fixes only.

If you experienced subsection duplication in v0.4.0-v0.4.2:

  • This is now fixed in v0.4.3
  • Simply upgrade and the issue will be resolved

Testing the Release

Quick Test

- uses: quantecon/action-translation-sync@v0.4.3
  with:
    target-repo: 'your-org/your-repo.zh-cn'
    target-language: 'zh-cn'
    anthropic-api-key: ${{ secrets.ANTHROPIC_API_KEY }}
    github-token: ${{ secrets.GITHUB_TOKEN }}

Verify Subsection Handling

Check the translated document's frontmatter heading-map:

---
kernelspec: ...
heading-map:
  'Introduction': '简介'
  'Background': '背景'
  'Theory': '理论'
  'Mathematical Framework': '数学框架'  # subsection
  'Assumptions': '假设'  # subsection
  ...
---

You should see both sections (##) and subsections (###) in the heading-map.


Documentation Updates

Updated Documentation

  • ✅ IMPLEMENTATION.md - Comprehensive rewrite with subsection handling details
  • ✅ TESTING.md - Consolidated guide (1197→413 lines)
  • ✅ ARCHITECTURE.md - Added subsection support explanation
  • ✅ STATUS-REPORT.md - Current status (362→143 lines)
  • ✅ TODO.md - v0.4.3 complete, v1.0 roadmap
  • ✅ INDEX.md - Clean structure, 12 core docs

Cleaned Up

  • Removed temporary validation/regression test documents
  • Removed historical archive
  • All docs reflect current v0.4.3 state

Total: 12 focused documentation files


Known Issues

None - All known bugs from v0.4.0-v0.4.2 are fixed.


What's Next

v1.0 - API Stabilization

Focus: Freeze public interfaces, guarantee backward compatibility

Timeline: Q1 2026 (pending production validation)

Requirements:

  • 95%+ test coverage (currently ~85%)
  • Real-world validation with QuantEcon lectures
  • Performance benchmarks
  • API documentation freeze
  • Semantic versioning commitment

v1.1+ - Feature Enhancements

Planned Features:

  • Additional languages (Japanese, Spanish)
  • Custom glossaries per repository
  • Translation memory/caching
  • Performance optimizations
  • Quality metrics

Contributors

  • Development: QuantEcon Team
  • Testing: Comprehensive automated test suite
  • Documentation: Complete review and cleanup

Resources


Changelog

Added

  • 10 new regression tests for subsection handling (87 total tests)
  • Comprehensive test coverage for document reconstruction
  • Comprehensive test coverage for heading-map integration

Fixed

  • Critical: Subsection duplication bug in extractSectionsWithSubsections()
  • Subsections now correctly cloned instead of referenced

Changed

  • Documentation cleanup (removed archive, consolidated files)
  • STATUS-REPORT.md reduced by 60% (362→143 lines)
  • All docs updated to reflect v0.4.3

Removed

  • Historical archive folder
  • Temporary validation and test tracking documents

Full Changelog: v0.3.0...v0.4.3


Released: October 18, 2025
Status: ✅ Production-Ready