Run artifact

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

FEATURE: Conditionals and Exception Flow

FieldValue
Version20220822 V1
DescriptionProvide jq conditional branching, try/catch handling, and optional evaluation.
Depends OnARCHITECTURE.md, FEATURE-FLOW-002.md
Providesif, then, elif, else, try, catch, optional control flow
Consumesordered generator evaluator, runtime error model

Intent

Implement if/then/elif/else/end, try/catch, and the ? optional operator. Branches must run once per condition output, preserve generator ordering, suppress only the errors requested by the filter, and retain outputs produced before an uncaught runtime error.

Programmatic Acceptance

=== AC flow-003-conformance ===
Intent: The implementation passes the authoritative corpus slice covering conditionals, try/catch, and optional evaluation.
Suite: scoped
Requires: executable=python3; scope=test

import json import os import subprocess import sys

select = r"if |try |\?" 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) summary = report["summary"] assert sum(summary.values()) > 0 assert summary["fail"] == 0 and summary["error"] == 0 assert result.returncode == 0 === END AC flow-003-conformance ===

User Acceptance

Guardrails