A human-friendly DSL for ATProto Lexicons
1

Configure Feed

Select the types of activity you want to include in your feed.

README.md

Real-World Tests#

Tests that fetch and validate real lexicons from production networks.

Tests#

roundtrip.rs - Round-Trip Test#

Validates that MLF can accurately convert lexicons: JSON → MLF → JSON

What it does:

  1. Fetches real lexicons from production networks:
    • app.bsky.actor.*, app.bsky.feed.*, app.bsky.graph.*
    • net.anisota.*
    • place.stream.*
    • pub.leaflet.*
  2. Converts downloaded JSON to MLF (automatic during fetch)
  3. Generates JSON back from MLF files
  4. Compares original vs regenerated JSON

Running:

# Using just
just test-real-world

# Using cargo
cargo test -p mlf-integration-tests --test real_world_roundtrip -- --ignored --nocapture

Network-dependent: This test fetches from real networks, so it:

  • Is marked #[ignore] by default
  • Requires internet connectivity
  • Takes 30-60 seconds to run

Diff files: When differences are found, the test writes three files per lexicon to roundtrip/diffs/:

  • {nsid}.original.json - The original fetched JSON
  • {nsid}.generated.json - The regenerated JSON from MLF
  • {nsid}.diff - Unified diff output (diff -u)

Files are organized into subdirectories:

  • diffs/acceptable/ - Acceptable differences (field ordering, $type fields)
  • diffs/failure/ - Structural differences that indicate bugs

These files are gitignored but persisted locally for review.

Adding New Tests#

To add more real-world test sources:

  1. Edit TEST_SOURCES in roundtrip.rs
  2. Ensure the NSID has published DNS TXT records
  3. Test with mlf fetch <nsid> first to verify

Notes#

  • These tests validate the core MLF workflow end-to-end
  • Failures indicate bugs in either JSON→MLF or MLF→JSON conversion
  • Review diff files to diagnose what changed