Run artifact

workspace/targets/jq/blueprint/FEATURE-FLOW-005.md

FEATURE: Reductions and Iteration Controls

FieldValue
Version20260822 V1
DescriptionProvides jq reductions and generator iteration-control builtins.
Depends OnARCHITECTURE.md, FEATURE-FLOW-004.md
Providesreduce, foreach, range, limit, skip, first, last, nth
Consumesordered generator evaluator, lexical labels, variable bindings

Workflow

Reduction and iteration controls consume ordered generator streams and preserve jq's state, ordering, Cartesian argument, backtracking, and short-circuit semantics.

Programmatic Acceptance

=== AC flow-005-conformance ===
Intent: The executable passes the authoritative conformance cases exercising reductions and iteration controls.
Suite: scoped
Requires: executable=python3; scope=test

import json import os import subprocess import sys

SELECT = r"reduce|foreach|limit|skip|nth|first|last" result = subprocess.run( [sys.executable, "sources/run_conformance.py", "--select", SELECT, "--json"], capture_output=True, text=True, env={**os.environ, "JQ": f"{os.getcwd()}/jq"}, ) print(result.stdout) print(result.stderr, file=sys.stderr) report = json.loads(result.stdout) tally = report["summary"] assert sum(tally.values()) > 0 assert tally["fail"] == 0 and tally["error"] == 0 assert result.returncode == 0 === END AC flow-005-conformance ===

User Acceptance

Guardrails