Skip to content

Comments

TOON v3.0 Spec Compliance#12

Merged
mischasigtermans merged 5 commits intomainfrom
feat/spec-test-fixtures
Jan 20, 2026
Merged

TOON v3.0 Spec Compliance#12
mischasigtermans merged 5 commits intomainfrom
feat/spec-test-fixtures

Conversation

@mischasigtermans
Copy link
Owner

Summary

  • Full TOON v3.0 specification compliance
  • Official spec test fixtures from toon-format/spec
  • Code cleanup: extracted duplicate logic, removed redundant comments
  • ~50% token reduction vs JSON (verified benchmarks)

Features Added

  • key_folding config: collapse single-key nested objects to dot notation
  • key_folding_depth config: limit folding depth
  • expand_paths config: expand dotted keys back to nested objects on decode
  • Strict mode with detailed validation errors
  • Delimiter support (comma, tab, pipe)

Breaking Changes

  • String escaping now uses quoted strings ("hello, world") instead of backslash escaping
  • Removed escape_style config option

Code Quality

  • Extracted shouldSkipKeyValue() to remove 3x duplication in encoder
  • Extracted findUnquoted() to remove 5x duplication in decoder
  • Added indentStr() caching for performance
  • Removed ~40 redundant comments

Test plan

  • 470 tests pass
  • Benchmarks verified on production data (~53% savings)
  • Round-trip fidelity confirmed with production test cases

@mischasigtermans mischasigtermans changed the title TOON v3.0 Spec Compliance & Official Test Fixtures TOON v3.0 Spec Compliance Jan 20, 2026
@mischasigtermans mischasigtermans merged commit f151e8c into main Jan 20, 2026
9 checks passed
@mischasigtermans mischasigtermans deleted the feat/spec-test-fixtures branch January 21, 2026 18:14
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.

1 participant