ADR 0016 - Ordering and stability
- Status: accepted
- Date: 2026-05-08
- Spec target: XTL 0.1 draft
- Affects: language.md, evaluation.md
Context
Three ordering questions have lurked under the spec without a normative answer. Each one is a portability hazard if two conformant implementations make different choices:
@sortstability.evaluation.mddefines the directive pipeline (filter → sort → top) but never says whether@sortpreserves the relative order of rows that have equal sort keys. Two implementations could sort identically by key and still differ on tie order.- File group output order. When
output_file_patternproduces multiple files (one perCustomer, etc.), the spec doesn't say in what order those files appear in the result list / zip. The reference impl uses first-seen order today; that is observable behavior nobody pinned. - Sheet group order within a file. When a sheet template has a
group key (
Regionetc.) and produces multiple sheets per file, the order is currentlyorder.sort()— lexicographic on the canonical-string-form group key. That is inconsistent with the file-group rule and depends on the JS default sort, which produces a different relative ordering than file groups for the same data.
Pre-1.0 is the right window to lock these.