{"id":"sort-external-merge","text":"`Sort` stage spills sorted chunks to temp JSONL files when the in-memory buffer exceeds `memory_limit`, then uses `heapq.merge` with a `KeyedRecord` wrapper (seq tiebreaker) for stable k-way merge","truth_value":"IN","source":"entries/2026/05/29/batch-word-count-pipeline.md","source_url":"","source_hash":"","justifications":[],"dependents":["pipeline-stages-hide-materialization-barriers"],"metadata":{},"created_at":"","updated_at":"","reviewed_at":"","verified_at":"","retracted_at":"","explanation":{"steps":[{"node":"sort-external-merge","truth_value":"IN","reason":"premise"}]}}