Problem / outcome
Implement RFC 001 Rev 3 <fm-list> evaluation/rendering for a JSONPath query that selects exactly one one-dimensional scalar YAML sequence, including split empty/null fallbacks and whole-list atomic failure.
Epic: #111. Milestone: 3 — Formatting and lists.
In scope
- Require a nodelist containing exactly one sequence node;
$.steps is valid while $.steps[*] selects members and is a cardinality/shape error.
- Extract only the selected sequence's immediate members, preserving order and duplicates without recursive flattening.
- Apply
default-zero to zero selected nodes or an empty selected sequence.
- Apply
default-null to a selected null node or a sequence containing only null members.
- Reject multiple selected nodes, scalar/mapping selections, mixed null/scalar sequences, nested sequences/mappings, and any invalid member atomically.
- Apply
item-type coercion to every valid scalar member.
- Render ordered/unordered success caches as exact list HTML and inline formats through locale-aware list formatting.
- Render block or inline fallbacks as escaped literal text with no list/list-item wrapper.
- Compare existing caches for freshness without trusting child markup.
Relevant specification sections
- §2.2
<fm-list> Rev 3 attributes, placement, formats, styles, and fallback cache shape.
- §2.3
array defaults/cascade.
- §3.6–3.9 cardinality, shape, split fallback, formatting, and escaping.
- §8 list-result rationale.
Dependencies and blockers
Implementation considerations
- Reuse scalar coercion per item but stage every result before emitting an edit.
- Successful block serialization permits only required list/list-item markup; fallback serialization uses scalar-cache text escaping.
- Keep locale-sensitive adapters isolated from portable cardinality/shape/fallback semantics.
- Record query nodelist cardinality, selected sequence metadata, effective locale/style, and failure member location for explain output.
Acceptance Criteria
Test requirements
- Language-neutral fixtures for
$.items versus $.items[*], nodelist cardinality, empty/all-null/mixed-null, shape/coercion, duplicates/order, split fallbacks, atomic failure, escaping, and block structure.
- Fixed-locale tests for list types/styles, one/two/many items, Unicode, and Apple/Linux behavior.
Documentation / CLI-help impact
- Examples for query-to-sequence semantics, both fallbacks, all five formats, three inline styles, locale requirements, and block placement/fallback shape.
Explicitly deferred
- Rendering arbitrary JSONPath nodelists directly, recursive flattening, mappings, custom item templates, Markdown list-marker caches, and arbitrary child markup.
Problem / outcome
Implement RFC 001 Rev 3
<fm-list>evaluation/rendering for a JSONPath query that selects exactly one one-dimensional scalar YAML sequence, including split empty/null fallbacks and whole-list atomic failure.Epic: #111. Milestone: 3 — Formatting and lists.
In scope
$.stepsis valid while$.steps[*]selects members and is a cardinality/shape error.default-zeroto zero selected nodes or an empty selected sequence.default-nullto a selected null node or a sequence containing only null members.item-typecoercion to every valid scalar member.Relevant specification sections
<fm-list>Rev 3 attributes, placement, formats, styles, and fallback cache shape.arraydefaults/cascade.Dependencies and blockers
Implementation considerations
Acceptance Criteria
default-zero/unresolved-zero; all-null sequences usedefault-null/unresolved-null.item-typebehave consistently and atomically.Test requirements
$.itemsversus$.items[*], nodelist cardinality, empty/all-null/mixed-null, shape/coercion, duplicates/order, split fallbacks, atomic failure, escaping, and block structure.Documentation / CLI-help impact
Explicitly deferred