{
  "version": 1,
  "import": {
    "root": "/mnt/c/Users/barlo/projects/drydock/uat/jq/runs/20261028.145919/sources",
    "format": "markdown"
  },
  "sources": {
    "INSTRUCTIONS.md": {
      "state": "current",
      "versions": [
        {
          "commit": "fa3e338",
          "date": "2026-10-28",
          "hash": "51b43aaf9eec2855347c8e6f57ca4eb52e36b8cc9202d0177cffe429aaa8aeea",
          "release": "",
          "state": "consumed",
          "via": "plan",
          "ticket": null,
          "requirements": [
            {
              "name": "implement-jq",
              "text": "Build an interpreter for the jq language as described in `sources/jq-manual.txt`.\nCorrectness is measured by the upstream jq conformance corpus, `sources/jq.test`, taken\nverbatim from jq 1.8.2. The goal is to pass every case the corpus supplies, with none\nfailed and none errored. The suite's size is a property of the pinned corpus; never\nassert a case count.",
              "stories": [
                "lexer",
                "parser",
                "core",
                "constructors",
                "operators",
                "control",
                "bindings",
                "paths",
                "assignment",
                "loops",
                "conversion",
                "collection-builtins",
                "strings",
                "formats",
                "numeric",
                "dates",
                "traversal",
                "io",
                "sql"
              ]
            },
            {
              "name": "python-implementation",
              "text": "The implementation language is Python, fixed by this Target's `TECHNOLOGY_STACK.md` and\ngoverned by `stack/python.md`.",
              "stories": [
                "foundation"
              ]
            },
            {
              "name": "generator-evaluation",
              "text": "jq is a small language with a large semantic core. Almost every filter is a **generator**:\nit takes one input and produces a stream of zero, one, or many outputs, and downstream\nfilters run once per upstream output. Backtracking through that stream is not an\noptimisation, it is the evaluation model, and `reduce`, `foreach`, `limit`, `first`,\n`label`/`break`, and the `?//` destructuring alternative are all defined in terms of it.",
              "stories": [
                "core",
                "constructors",
                "operators",
                "control",
                "bindings",
                "loops"
              ]
            },
            {
              "name": "command-interface",
              "text": "The program is a filter: an executable file named `jq` at the application root, invoked as\n\n```\n./jq -c '<program>'\n```\n\nwith JSON on **stdin**. It writes each value the program produces to **stdout** as one\ncompact JSON value per line, and exits `0`.",
              "stories": [
                "cli",
                "core"
              ]
            },
            {
              "name": "exit-codes",
              "text": "Exit codes follow jq's own, and the distinction is load-bearing because the harness grades\non it:\n\n| Exit | Meaning |\n|---|---|\n| `0` | the program compiled and ran to completion |\n| `3` | the program did not compile \u2014 a syntax or static error |\n| `5` | the program compiled but raised at run time |\n\nA case may legitimately emit several values and then raise; the harness compares the values\nproduced before the raise, so exit `5` is not by itself a failure. Exit `3` on a valid\nprogram is always a failure. Diagnostics go to **stderr** and are never compared.",
              "stories": [
                "cli",
                "parser",
                "core"
              ]
            },
            {
              "name": "scoped-acceptance",
              "text": "**Every other story runs its own slice, and the slice executes cases.** Each story's\nacceptance invokes `sources/run_conformance.py` with a `--select` expression scoped to the\nconstruct that story implements, supplies `JQ`, and asserts `result.returncode == 0`. Those\nare exactly the cases the story's code is supposed to pass, so the run is neither slow nor\nred by construction, and the corpus goes green in the order the plan builds it.",
              "stories": [
                "lexer",
                "parser",
                "core",
                "constructors",
                "operators",
                "control",
                "bindings",
                "paths",
                "assignment",
                "loops",
                "conversion",
                "collection-builtins",
                "strings",
                "formats",
                "numeric",
                "dates",
                "traversal",
                "io",
                "sql",
                "cli",
                "scoped-integration"
              ]
            },
            {
              "name": "stage-source-assets",
              "text": "Record this table in the Analysis so every asset is staged onto disk in the build\ndirectory. `sources/jq-manual.txt`, `sources/jq.test`, `sources/parser.y`, and\n`sources/lexer.l` are large and must be readable from disk during implementation rather\nthan carried in prompt text.",
              "stories": [
                "corpus-staging"
              ]
            },
            {
              "name": "validate-corpus-harness",
              "text": "`--list` prints the matching cases and runs nothing. Use it while planning, to size and\ninspect a selector before committing to it. An acceptance check that invokes it executes\nnothing, passes before the story's code exists, and steers no repair; such a check is a\ndefect. The one exception is the story whose only obligation is that the corpus parses, the\nexclusion list applies, and the harness starts \u2014 it implements none of the behaviour under\ntest, so listing is the correct thing for it to assert.",
              "stories": [
                "corpus-staging"
              ]
            },
            {
              "name": "module-grammar-rejection",
              "text": "The module *grammar* cases are **not** excluded and must pass. `module (.+1); 0`,\n`module []; 0`, `include \"a\" (.+1); 0`, `include \"a\" []; 0`, `include \"\\ \"; 0`,\n`include \"\\(a)\"; 0`, and `%::wat` are all `%%FAIL` cases: the front end must parse the\nmodule syntax far enough to reject them, without ever touching the filesystem.",
              "stories": [
                "lexer",
                "parser"
              ]
            },
            {
              "name": "numeric-edge-cases",
              "text": "7. **Numbers and edge cases.** `nan`, `infinite`, integer/float equality, large literals,\n   and the `have_decnum` builtin \u2014 return `false` from it and the corpus takes its\n   non-decNumber branch, which native floats satisfy.",
              "stories": [
                "numeric",
                "operators",
                "lexer"
              ]
            },
            {
              "name": "terminal-conformance",
              "text": "**Exactly one acceptance check runs the whole corpus.** One terminal story \u2014 the last one \u2014\nruns `sh sources/full_test.sh`, asserts only `result.returncode == 0`, prints the captured\nstdout and stderr so a failure can be diagnosed from the evidence, and carries the Sea\nTrial. No other acceptance check may run the corpus unscoped, and none may invoke\n`full_test.sh` at all.",
              "stories": [
                "terminal-verification"
              ]
            },
            {
              "name": "document-interface",
              "text": "- Deliver a concise project `README.md` documenting the stdin/stdout interface, the exit\n  codes, and the `sh sources/full_test.sh` command.",
              "stories": [
                "documentation"
              ]
            }
          ]
        }
      ]
    },
    "builtin.jq": {
      "state": "current",
      "versions": [
        {
          "commit": "fa3e338",
          "date": "2026-10-28",
          "hash": "b8a5fd9579be9b51c9a04e6620f8c1655539aa57eea33a84e202a8dea401f2a4",
          "release": "",
          "state": "consumed",
          "via": "plan",
          "ticket": null,
          "requirements": [
            {
              "name": "halt-error",
              "text": "def halt_error: halt_error(5);",
              "stories": [
                "io"
              ]
            },
            {
              "name": "error-message",
              "text": "def error(msg): msg|error;",
              "stories": [
                "control"
              ]
            },
            {
              "name": "map",
              "text": "def map(f): [.[] | f];",
              "stories": [
                "collection-builtins"
              ]
            },
            {
              "name": "select",
              "text": "def select(f): if f then . else empty end;",
              "stories": [
                "collection-builtins"
              ]
            },
            {
              "name": "sort-by",
              "text": "def sort_by(f): _sort_by_impl(map([f]));",
              "stories": [
                "collection-builtins"
              ]
            },
            {
              "name": "group-by",
              "text": "def group_by(f): _group_by_impl(map([f]));",
              "stories": [
                "collection-builtins"
              ]
            },
            {
              "name": "unique-by",
              "text": "def unique_by(f): _unique_by_impl(map([f]));",
              "stories": [
                "collection-builtins"
              ]
            },
            {
              "name": "max-by",
              "text": "def max_by(f): _max_by_impl(map([f]));",
              "stories": [
                "collection-builtins"
              ]
            },
            {
              "name": "min-by",
              "text": "def min_by(f): _min_by_impl(map([f]));",
              "stories": [
                "collection-builtins"
              ]
            },
            {
              "name": "add",
              "text": "def add(f): reduce f as $x (null; . + $x);\ndef add: add(.[]);",
              "stories": [
                "collection-builtins"
              ]
            },
            {
              "name": "delete-paths",
              "text": "def del(f): delpaths([path(f)]);",
              "stories": [
                "assignment",
                "paths"
              ]
            },
            {
              "name": "absolute-value",
              "text": "def abs: if . < 0 then - . else . end;",
              "stories": [
                "numeric"
              ]
            },
            {
              "name": "assign-paths",
              "text": "def _assign(paths; $value): reduce path(paths) as $p (.; setpath($p; $value));",
              "stories": [
                "assignment",
                "paths"
              ]
            },
            {
              "name": "modify-paths",
              "text": "def _modify(paths; update):\n    reduce path(paths) as $p ([., []];\n        . as $dot\n      | null\n      | label $out\n      | ($dot[0] | getpath($p)) as $v\n      | (\n          (   $$$$v\n            | update\n            | (., break $out) as $v\n            | $$$$dot\n            | setpath([0] + $p; $v)\n          ),\n          (\n              $$$$dot\n            | setpath([1, (.[1] | length)]; $p)\n          )\n        )\n    ) | . as $dot | $dot[0] | delpaths($dot[1]);",
              "stories": [
                "assignment",
                "paths"
              ]
            },
            {
              "name": "map-values",
              "text": "def map_values(f): .[] |= f;",
              "stories": [
                "collection-builtins",
                "assignment"
              ]
            },
            {
              "name": "recurse",
              "text": "def recurse(f): def r: ., (f | r); r;\ndef recurse(f; cond): def r: ., (f | select(cond) | r); r;\ndef recurse: recurse(.[]?);",
              "stories": [
                "traversal"
              ]
            },
            {
              "name": "to-entries",
              "text": "def to_entries: [keys_unsorted[] as $k | {key: $k, value: .[$k]}];",
              "stories": [
                "collection-builtins"
              ]
            },
            {
              "name": "from-entries",
              "text": "def from_entries: map({ (.key // .Key // .name // .Name):\n  if has(\"value\") then .value else .Value end }) | add // {};",
              "stories": [
                "collection-builtins"
              ]
            },
            {
              "name": "with-entries",
              "text": "def with_entries(f): to_entries | map(f) | from_entries;",
              "stories": [
                "collection-builtins"
              ]
            },
            {
              "name": "reverse",
              "text": "def reverse: [.[length - 1 - range(0;length)]];",
              "stories": [
                "collection-builtins"
              ]
            },
            {
              "name": "indices",
              "text": "def indices($i): if type == \"array\" and ($i|type) == \"array\" then .[$i]\n  elif type == \"array\" then .[[$i]]\n  elif type == \"string\" and ($i|type) == \"string\" then _strindices($i)\n  else .[$i] end;",
              "stories": [
                "collection-builtins",
                "strings"
              ]
            },
            {
              "name": "index",
              "text": "def index($i):   indices($i) | .[0];       # TODO: optimize",
              "stories": [
                "collection-builtins",
                "strings"
              ]
            },
            {
              "name": "rindex",
              "text": "def rindex($i):  indices($i) | .[-1:][0];  # TODO: optimize",
              "stories": [
                "collection-builtins",
                "strings"
              ]
            },
            {
              "name": "paths",
              "text": "def paths: path(recurse)|select(length > 0);\ndef paths(node_filter): path(recurse|select(node_filter))|select(length > 0);",
              "stories": [
                "paths",
                "traversal"
              ]
            },
            {
              "name": "isfinite",
              "text": "def isfinite: type == \"number\" and (isinfinite | not);",
              "stories": [
                "numeric"
              ]
            },
            {
              "name": "arrays",
              "text": "def arrays: select(type == \"array\");",
              "stories": [
                "conversion"
              ]
            },
            {
              "name": "objects",
              "text": "def objects: select(type == \"object\");",
              "stories": [
                "conversion"
              ]
            },
            {
              "name": "iterables",
              "text": "def iterables: select(type|. == \"array\" or . == \"object\");",
              "stories": [
                "conversion"
              ]
            },
            {
              "name": "booleans",
              "text": "def booleans: select(type == \"boolean\");",
              "stories": [
                "conversion"
              ]
            },
            {
              "name": "numbers",
              "text": "def numbers: select(type == \"number\");",
              "stories": [
                "conversion"
              ]
            },
            {
              "name": "normals",
              "text": "def normals: select(isnormal);",
              "stories": [
                "numeric"
              ]
            },
            {
              "name": "finites",
              "text": "def finites: select(isfinite);",
              "stories": [
                "numeric"
              ]
            },
            {
              "name": "strings",
              "text": "def strings: select(type == \"string\");",
              "stories": [
                "conversion"
              ]
            },
            {
              "name": "nulls",
              "text": "def nulls: select(. == null);",
              "stories": [
                "conversion"
              ]
            },
            {
              "name": "values",
              "text": "def values: select(. != null);",
              "stories": [
                "conversion"
              ]
            },
            {
              "name": "scalars",
              "text": "def scalars: select(type|. != \"array\" and . != \"object\");",
              "stories": [
                "conversion"
              ]
            },
            {
              "name": "join",
              "text": "def join($x): reduce .[] as $i (null;\n            (if .==null then \"\" else .+$x end) +\n            ($i | if type==\"boolean\" or type==\"number\" then tostring else .//\"\" end)\n        ) // \"\";",
              "stories": [
                "strings"
              ]
            },
            {
              "name": "flatten",
              "text": "def _flatten($x): reduce .[] as $i ([]; if $i | type == \"array\" and $x != 0 then . + ($i | _flatten($x-1)) else . + [$i] end);\ndef flatten($x): if $x < 0 then error(\"flatten depth must not be negative\") else _flatten($x) end;\ndef flatten: _flatten(-1);",
              "stories": [
                "collection-builtins"
              ]
            },
            {
              "name": "range-to",
              "text": "def range($x): range(0;$x);",
              "stories": [
                "loops"
              ]
            },
            {
              "name": "iso-date-conversion",
              "text": "def fromdateiso8601: strptime(\"%Y-%m-%dT%H:%M:%SZ\")|mktime;\ndef todateiso8601: strftime(\"%Y-%m-%dT%H:%M:%SZ\");\ndef fromdate: fromdateiso8601;\ndef todate: todateiso8601;",
              "stories": [
                "dates"
              ]
            },
            {
              "name": "trim-left",
              "text": "def ltrimstr($left): if startswith($left) then .[$left | length:] end;",
              "stories": [
                "strings"
              ]
            },
            {
              "name": "trim-right",
              "text": "def rtrimstr($right): if endswith($right) then .[:length - ($right | length)] end;",
              "stories": [
                "strings"
              ]
            },
            {
              "name": "trim-string",
              "text": "def trimstr($val): ltrimstr($val) | rtrimstr($val);",
              "stories": [
                "strings"
              ]
            },
            {
              "name": "match",
              "text": "def match(re; mode): _match_impl(re; mode; false)|.[];\ndef match($val): ($val|type) as $vt | if $vt == \"string\" then match($val; null)\n   elif $vt == \"array\" and ($val | length) > 1 then match($val[0]; $val[1])\n   elif $vt == \"array\" and ($val | length) > 0 then match($val[0]; null)\n   else error( $vt + \" not a string or array\") end;",
              "stories": [
                "strings"
              ]
            },
            {
              "name": "test-regex",
              "text": "def test(re; mode): _match_impl(re; mode; true);\ndef test($val): ($val|type) as $vt | if $vt == \"string\" then test($val; null)\n   elif $vt == \"array\" and ($val | length) > 1 then test($val[0]; $val[1])\n   elif $vt == \"array\" and ($val | length) > 0 then test($val[0]; null)\n   else error( $vt + \" not a string or array\") end;",
              "stories": [
                "strings"
              ]
            },
            {
              "name": "capture",
              "text": "def capture(re; mods): match(re; mods) | reduce ( .captures | .[] | select(.name != null) | { (.name) : .string } ) as $pair ({}; . + $pair);\ndef capture($val): ($val|type) as $vt | if $vt == \"string\" then capture($val; null)\n   elif $vt == \"array\" and ($val | length) > 1 then capture($val[0]; $val[1])\n   elif $vt == \"array\" and ($val | length) > 0 then capture($val[0]; null)\n   else error( $vt + \" not a string or array\") end;",
              "stories": [
                "strings"
              ]
            },
            {
              "name": "scan",
              "text": "def scan($re; $flags):\n  match($re; \"g\" + $flags)\n    | if (.captures|length > 0)\n      then [ .captures | .[] | .string ]\n      else .string\n      end;\ndef scan($re): scan($re; null);",
              "stories": [
                "strings"
              ]
            },
            {
              "name": "splits",
              "text": "# splits/1 produces a stream; split/1 is retained for backward compatibility.\ndef splits($re; $flags):\n  .[foreach (match($re; $flags+\"g\"), null) as {$offset, $length}\n      (null; {start: .next, end: $offset, next: ($offset+$length)})];\ndef splits($re): splits($re; null);",
              "stories": [
                "strings"
              ]
            },
            {
              "name": "split",
              "text": "# split emits an array for backward compatibility\ndef split($re; $flags): [ splits($re; $flags) ];",
              "stories": [
                "strings"
              ]
            },
            {
              "name": "sub",
              "text": "# If s contains capture variables, then create a capture object and pipe it to s, bearing\n# in mind that s could be a stream\ndef sub($re; s; $flags):\n   . as $in\n   | (reduce match($re; $flags) as $edit\n        ({result: [], previous: 0};\n            $in[ .previous: ($edit | .offset) ] as $gap\n            # create the \"capture\" objects (one per item in s)\n            | [reduce ( $edit | .captures | .[] | select(.name != null) | { (.name) : .string } ) as $pair\n                 ({}; . + $pair) | s ] as $inserts\n            | reduce range(0; $inserts|length) as $ix (.; .result[$ix] += $gap + $inserts[$ix])\n            | .previous = ($edit | .offset + .length ) )\n          | .result[] + $in[.previous:] )\n      // $in;\n\ndef sub($re; s): sub($re; s; \"\");",
              "stories": [
                "strings"
              ]
            },
            {
              "name": "gsub",
              "text": "def gsub($re; s; flags): sub($re; s; flags + \"g\");\ndef gsub($re; s): sub($re; s; \"g\");",
              "stories": [
                "strings"
              ]
            },
            {
              "name": "while",
              "text": "def while(cond; update):\n     def _while:\n         if cond then ., (update | _while) else empty end;\n     _while;",
              "stories": [
                "loops"
              ]
            },
            {
              "name": "until",
              "text": "def until(cond; next):\n     def _until:\n         if cond then . else (next|_until) end;\n     _until;",
              "stories": [
                "loops"
              ]
            },
            {
              "name": "limit",
              "text": "def limit($n; expr):\n  if $n > 0 then label $out | foreach expr as $item ($n; . - 1; $item, if . <= 0 then break $out else empty end)\n  elif $n == 0 then empty\n  else error(\"limit doesn't support negative count\") end;",
              "stories": [
                "loops"
              ]
            },
            {
              "name": "skip",
              "text": "def skip($n; expr):\n  if $n > 0 then foreach expr as $item ($n; . - 1; if . < 0 then $item else empty end)\n  elif $n == 0 then expr\n  else error(\"skip doesn't support negative count\") end;",
              "stories": [
                "loops"
              ]
            },
            {
              "name": "range-step",
              "text": "# range/3, with a `by` expression argument\ndef range($init; $upto; $by):\n    if $by > 0 then $init|while(. < $upto; . + $by)\n  elif $by < 0 then $init|while(. > $upto; . + $by)\n  else empty end;",
              "stories": [
                "loops"
              ]
            },
            {
              "name": "first-generator",
              "text": "def first(g): label $out | g | ., break $out;",
              "stories": [
                "loops"
              ]
            },
            {
              "name": "isempty",
              "text": "def isempty(g): first((g|false), true);",
              "stories": [
                "loops"
              ]
            },
            {
              "name": "all",
              "text": "def all(generator; condition): isempty(generator|condition and empty);\ndef all(condition): all(.[]; condition);\ndef all: all(.[]; .);",
              "stories": [
                "loops",
                "collection-builtins"
              ]
            },
            {
              "name": "any",
              "text": "def any(generator; condition): isempty(generator|condition or empty)|not;\ndef any(condition): any(.[]; condition);\ndef any: any(.[]; .);",
              "stories": [
                "loops",
                "collection-builtins"
              ]
            },
            {
              "name": "nth-generator",
              "text": "def nth($n; g):\n  if $n < 0 then error(\"nth doesn't support negative indices\")\n  else first(skip($n; g)) end;",
              "stories": [
                "loops"
              ]
            },
            {
              "name": "first-element",
              "text": "def first: .[0];",
              "stories": [
                "collection-builtins"
              ]
            },
            {
              "name": "last-element",
              "text": "def last: .[-1];",
              "stories": [
                "collection-builtins"
              ]
            },
            {
              "name": "nth-element",
              "text": "def nth($n): .[$n];",
              "stories": [
                "collection-builtins"
              ]
            },
            {
              "name": "combinations",
              "text": "def combinations:\n    if length == 0 then [] else\n        .[0][] as $x\n          | (.[1:] | combinations) as $y\n          | [$x] + $y\n    end;\ndef combinations(n):\n    . as $dot\n      | [range(n) | $dot]\n      | combinations;",
              "stories": [
                "collection-builtins"
              ]
            },
            {
              "name": "transpose",
              "text": "# transpose a possibly jagged matrix, quickly;\n# rows are padded with nulls so the result is always rectangular.\ndef transpose: [range(0; map(length)|max // 0) as $i | [.[][$i]]];",
              "stories": [
                "collection-builtins"
              ]
            },
            {
              "name": "in",
              "text": "def in(xs): . as $x | xs | has($x);",
              "stories": [
                "collection-builtins"
              ]
            },
            {
              "name": "inside",
              "text": "def inside(xs): . as $x | xs | contains($x);",
              "stories": [
                "collection-builtins"
              ]
            },
            {
              "name": "repeat",
              "text": "def repeat(exp):\n     def _repeat:\n         exp, _repeat;\n     _repeat;",
              "stories": [
                "loops"
              ]
            },
            {
              "name": "inputs",
              "text": "def inputs: try repeat(input) catch if .==\"break\" then empty else error end;",
              "stories": [
                "io"
              ]
            },
            {
              "name": "ascii-downcase",
              "text": "# like ruby's downcase - only characters A to Z are affected\ndef ascii_downcase:\n  explode | map( if 65 <= . and . <= 90 then . + 32  else . end) | implode;",
              "stories": [
                "strings"
              ]
            },
            {
              "name": "ascii-upcase",
              "text": "# like ruby's upcase - only characters a to z are affected\ndef ascii_upcase:\n  explode | map( if 97 <= . and . <= 122 then . - 32  else . end) | implode;",
              "stories": [
                "strings"
              ]
            },
            {
              "name": "truncate-stream",
              "text": "def truncate_stream(stream):\n  . as $n | null | stream | . as $input | if (.[0]|length) > $n then setpath([0];$input[0][$n:]) else empty end;",
              "stories": [
                "traversal"
              ]
            },
            {
              "name": "fromstream",
              "text": "def fromstream(i): {x: null, e: false} as $init |\n  # .x = object being built; .e = emit and reset state\n  foreach i as $i ($init\n  ; if .e then $init else . end\n  | if $i|length == 2\n    then setpath([\"e\"]; $i[0]|length==0) | setpath([\"x\"]+$i[0]; $i[1])\n    else setpath([\"e\"]; $i[0]|length==1) end\n  ; if .e then .x else empty end);",
              "stories": [
                "traversal"
              ]
            },
            {
              "name": "tostream",
              "text": "def tostream:\n  path(def r: (.[]?|r), .; r) as $p |\n  getpath($p) |\n  reduce path(.[]?) as $q ([$p, .]; [$p+$q]);",
              "stories": [
                "traversal"
              ]
            },
            {
              "name": "walk",
              "text": "# Apply f to composite entities recursively, and to atoms\ndef walk(f):\n  def w:\n    if type == \"object\"\n    then map_values(w)\n    elif type == \"array\" then map(w)\n    else .\n    end\n    | f;\n  w;",
              "stories": [
                "traversal"
              ]
            },
            {
              "name": "pick",
              "text": "# pathexps could be a stream of dot-paths\ndef pick(pathexps):\n  . as $in\n  | reduce path(pathexps) as $a (null;\n      setpath($a; $in|getpath($a)) );",
              "stories": [
                "paths"
              ]
            },
            {
              "name": "debug-messages",
              "text": "# ensure the output of debug(m1,m2) is kept together:\ndef debug(msgs): (msgs | debug | empty), .;",
              "stories": [
                "io"
              ]
            },
            {
              "name": "sql-index",
              "text": "def INDEX(stream; idx_expr):\n  reduce stream as $row ({}; .[$row|idx_expr|tostring] = $row);\ndef INDEX(idx_expr): INDEX(.[]; idx_expr);",
              "stories": [
                "sql"
              ]
            },
            {
              "name": "sql-join",
              "text": "def JOIN($idx; idx_expr):\n  [.[] | [., $idx[idx_expr]]];\ndef JOIN($idx; stream; idx_expr):\n  stream | [., $idx[idx_expr]];\ndef JOIN($idx; stream; idx_expr; join_expr):\n  stream | [., $idx[idx_expr]] | join_expr;",
              "stories": [
                "sql"
              ]
            },
            {
              "name": "sql-in",
              "text": "def IN(s): any(s == .; .);\ndef IN(src; s): any(src == s; .);",
              "stories": [
                "sql"
              ]
            }
          ]
        }
      ]
    },
    "exclusions.txt": {
      "state": "current",
      "versions": [
        {
          "commit": "fa3e338",
          "date": "2026-10-28",
          "hash": "0755022f0c2f339883aaa2668a10d6a11bc8f7c4a37b0743f213830d848a05d9",
          "release": "",
          "state": "consumed",
          "via": "plan",
          "ticket": null,
          "requirements": [
            {
              "name": "preserve-upstream-corpus",
              "text": "# The corpus in sources/jq.test is byte-for-byte upstream and is never edited. Where a case\n# cannot run under this kit's harness, it is named here instead, so every skip is visible,\n# reasoned, and auditable against the upstream file. This file is a scoring asset: it is\n# hash-verified against the import and restored before grading.",
              "stories": [
                "corpus-staging"
              ]
            },
            {
              "name": "reject-unmatched-exclusions",
              "text": "# One verbatim program line per entry. An entry that matches no case in the corpus is a hard\n# error (exit 2), not a shrug \u2014 a silent no-op would quietly re-admit a case the kit cannot run\n# if the corpus pin ever moved.",
              "stories": [
                "corpus-staging"
              ]
            },
            {
              "name": "exclude-module-loader-cases",
              "text": "# Only the loader cases are excluded. The module *grammar* cases \u2014 `module (.+1); 0`,\n# `module []; 0`, `include \"a\" (.+1); 0`, `include \"a\" []; 0`, `include \"\\ \"; 0`,\n# `include \"\\(a)\"; 0`, and `%::wat` \u2014 remain in the scored set: they are parse errors that a\n# correct front end rejects without ever touching the filesystem.",
              "stories": [
                "corpus-staging"
              ]
            },
            {
              "name": "reject-invalid-module-grammar",
              "text": "# Only the loader cases are excluded. The module *grammar* cases \u2014 `module (.+1); 0`,\n# `module []; 0`, `include \"a\" (.+1); 0`, `include \"a\" []; 0`, `include \"\\ \"; 0`,\n# `include \"\\(a)\"; 0`, and `%::wat` \u2014 remain in the scored set: they are parse errors that a\n# correct front end rejects without ever touching the filesystem.",
              "stories": [
                "lexer",
                "parser"
              ]
            }
          ]
        }
      ]
    },
    "full_test.sh": {
      "state": "current",
      "versions": [
        {
          "commit": "fa3e338",
          "date": "2026-10-28",
          "hash": "4df25cda12c2741ee02cb7e22d5e3b62161bd90fde948c88a675cb2a94e70fc5",
          "release": "",
          "state": "consumed",
          "via": "plan",
          "ticket": null,
          "requirements": [
            {
              "name": "executable-jq",
              "text": "The deliverable is an executable named jq that reads JSON on stdin.",
              "stories": [
                "cli"
              ]
            },
            {
              "name": "run-conformance",
              "text": "# full_test.sh \u2014 scoring entry point. Do not filter, skip, or reinterpret.",
              "stories": [
                "corpus-staging",
                "lexer",
                "parser",
                "core",
                "constructors",
                "operators",
                "control",
                "bindings",
                "paths",
                "assignment",
                "loops",
                "conversion",
                "collection-builtins",
                "strings",
                "formats",
                "numeric",
                "dates",
                "traversal",
                "io",
                "sql",
                "cli",
                "scoped-integration",
                "terminal-verification"
              ]
            }
          ]
        }
      ]
    },
    "jq-manual.txt": {
      "state": "current",
      "versions": [
        {
          "commit": "fa3e338",
          "date": "2026-10-28",
          "hash": "92fc1c179ee6e33d75ffc1f24dd1f0b8ddf5ea666a51224be5088d9431cd8ab3",
          "release": "",
          "state": "consumed",
          "via": "plan",
          "ticket": null,
          "requirements": [
            {
              "name": "identity",
              "text": "The absolute simplest filter is `.` .  This filter takes its\ninput and produces the same value as output.  That is, this\nis the identity operator.",
              "stories": [
                "core"
              ]
            },
            {
              "name": "object-identifier-index",
              "text": "The simplest *useful* filter has the form `.foo`. When given a\nJSON object (aka dictionary or hash) as input, `.foo` produces\nthe value at the key \"foo\" if the key is present, or null otherwise.\n\nA filter of the form `.foo.bar` is equivalent to `.foo | .bar`.\n\nThe `.foo` syntax only works for simple, identifier-like keys, that\nis, keys that are all made of alphanumeric characters and\nunderscore, and which do not start with a digit.\n\nIf the key contains special characters or starts with a digit,\nyou need to surround it with double quotes like this:\n`.\"foo$\"`, or else `.[\"foo$\"]`.",
              "stories": [
                "lexer",
                "parser",
                "constructors"
              ]
            },
            {
              "name": "optional-object-index",
              "text": "Just like `.foo`, but does not output an error when `.` is not an\nobject.",
              "stories": [
                "parser",
                "constructors",
                "control"
              ]
            },
            {
              "name": "object-index",
              "text": "You can also look up fields of an object using syntax like\n`.[\"foo\"]` (`.foo` above is a shorthand version of this, but\nonly for identifier-like strings).",
              "stories": [
                "parser",
                "constructors"
              ]
            },
            {
              "name": "array-index",
              "text": "When the index value is an integer, `.[<number>]` can index\narrays.  Arrays are zero-based, so `.[2]` returns the third\nelement.\n\nNegative indices are allowed, with -1 referring to the last\nelement, -2 referring to the next to last element, and so on.",
              "stories": [
                "parser",
                "constructors"
              ]
            },
            {
              "name": "slice",
              "text": "The `.[<number>:<number>]` syntax can be used to return a\nsubarray of an array or substring of a string. The array\nreturned by `.[10:15]` will be of length 5, containing the\nelements from index 10 (inclusive) to index 15 (exclusive).\nEither index may be negative (in which case it counts\nbackwards from the end of the array), or omitted (in which\ncase it refers to the start or end of the array).\nIndices are zero-based.",
              "stories": [
                "parser",
                "constructors",
                "strings"
              ]
            },
            {
              "name": "iterate-values",
              "text": "If you use the `.[index]` syntax, but omit the index\nentirely, it will return *all* of the elements of an\narray. Running `.[]` with the input `[1,2,3]` will produce the\nnumbers as three separate results, rather than as a single\narray. A filter of the form `.foo[]` is equivalent to\n`.foo | .[]`.\n\nYou can also use this on an object, and it will return all\nthe values of the object.",
              "stories": [
                "parser",
                "core",
                "constructors"
              ]
            },
            {
              "name": "optional-iterator",
              "text": "Like `.[]`, but no errors will be output if . is not an array\nor object. A filter of the form `.foo[]?` is equivalent to\n`.foo | .[]?`.",
              "stories": [
                "parser",
                "core",
                "constructors",
                "control"
              ]
            },
            {
              "name": "comma",
              "text": "If two filters are separated by a comma, then the\nsame input will be fed into both and the two filters' output\nvalue streams will be concatenated in order: first, all of the\noutputs produced by the left expression, and then all of the\noutputs produced by the right.",
              "stories": [
                "parser",
                "core"
              ]
            },
            {
              "name": "pipe",
              "text": "The | operator combines two filters by feeding the output(s) of\nthe one on the left into the input of the one on the right. It's\nsimilar to the Unix shell's pipe, if you're used to that.\n\nIf the one on the left produces multiple results, the one on\nthe right will be run for each of those results.",
              "stories": [
                "parser",
                "core"
              ]
            },
            {
              "name": "parentheses",
              "text": "Parenthesis work as a grouping operator just as in any typical\nprogramming language.",
              "stories": [
                "parser"
              ]
            },
            {
              "name": "types-and-literals",
              "text": "jq supports the same set of datatypes as JSON - numbers,\nstrings, booleans, arrays, objects (which in JSON-speak are\nhashes with only string keys), and \"null\".\n\nBooleans, null, strings and numbers are written the same way as\nin JSON. Just like everything else in jq, these simple\nvalues take an input and produce an output - `42` is a valid jq\nexpression that takes an input, ignores it, and returns 42\ninstead.\n\nNumbers in jq are internally represented by their IEEE754 double\nprecision approximation. Any arithmetic operation with numbers,\nwhether they are literals or results of previous filters, will\nproduce a double precision floating point result.\n\nHowever, when parsing a literal jq will store the original literal\nstring. If no mutation is applied to this value then it will make\nto the output in its original form, even if conversion to double\nwould result in a loss.",
              "stories": [
                "lexer",
                "parser",
                "core",
                "conversion",
                "numeric"
              ]
            },
            {
              "name": "array-construction",
              "text": "As in JSON, `[]` is used to construct arrays, as in\n`[1,2,3]`. The elements of the arrays can be any jq\nexpression, including a pipeline. All of the results produced\nby all of the expressions are collected into one big array.\nYou can use it to construct an array out of a known quantity\nof values (as in `[.foo, .bar, .baz]`) or to \"collect\" all the\nresults of a filter into an array (as in `[.items[].name]`)",
              "stories": [
                "parser",
                "core",
                "constructors"
              ]
            },
            {
              "name": "object-construction",
              "text": "Like JSON, `{}` is for constructing objects (aka\ndictionaries or hashes), as in: `{\"a\": 42, \"b\": 17}`.\n\nIf the keys are \"identifier-like\", then the quotes can be left\noff, as in `{a:42, b:17}`.  Variable references as key\nexpressions use the value of the variable as the key.  Key\nexpressions other than constant literals, identifiers, or\nvariable references, need to be parenthesized, e.g.,\n`{(\"a\"+\"b\"):59}`.\n\nThe value can be any expression (although you may need to wrap\nit in parentheses if, for example, it contains colons), which\ngets applied to the {} expression's input (remember, all\nfilters have an input and an output).",
              "stories": [
                "parser",
                "constructors",
                "bindings"
              ]
            },
            {
              "name": "object-construction-shorthand",
              "text": "Because that is so common, there's a shortcut syntax for it:\n`{user, title}`.",
              "stories": [
                "parser",
                "constructors",
                "bindings"
              ]
            },
            {
              "name": "object-construction-generators",
              "text": "If one of the expressions produces multiple results,\nmultiple dictionaries will be produced.",
              "stories": [
                "core",
                "constructors"
              ]
            },
            {
              "name": "recursive-descent",
              "text": "Recursively descends `.`, producing every value.  This is the\nsame as the zero-argument `recurse` builtin (see below).",
              "stories": [
                "parser",
                "traversal"
              ]
            },
            {
              "name": "operator-types",
              "text": "Some jq operators (for instance, `+`) do different things\ndepending on the type of their arguments (arrays, numbers,\netc.). However, jq never does implicit type conversions. If you\ntry to add a string to an object you'll get an error message and\nno result.",
              "stories": [
                "operators"
              ]
            },
            {
              "name": "addition",
              "text": "The operator `+` takes two filters, applies them both\nto the same input, and adds the results together. What\n\"adding\" means depends on the types involved:\n\n- **Numbers** are added by normal arithmetic.\n\n- **Arrays** are added by being concatenated into a larger array.\n\n- **Strings** are added by being joined into a larger string.\n\n- **Objects** are added by merging, that is, inserting all\n  the key-value pairs from both objects into a single\n  combined object. If both objects contain a value for the\n  same key, the object on the right of the `+` wins. (For\n  recursive merge use the `*` operator.)\n\n`null` can be added to any value, and returns the other\nvalue unchanged.",
              "stories": [
                "operators"
              ]
            },
            {
              "name": "subtraction",
              "text": "As well as normal arithmetic subtraction on numbers, the `-`\noperator can be used on arrays to remove all occurrences of\nthe second array's elements from the first array.",
              "stories": [
                "operators"
              ]
            },
            {
              "name": "multiplication-division-modulo",
              "text": "These infix operators behave as expected when given two numbers.\nDivision by zero raises an error. `x % y` computes x modulo y.\n\nMultiplying a string by a number produces the concatenation of\nthat string that many times. `\"x\" * 0` produces `\"\"`.\n\nDividing a string by another splits the first using the second\nas separators.\n\nMultiplying two objects will merge them recursively: this works\nlike addition but if both objects contain a value for the\nsame key, and the values are objects, the two are merged with\nthe same strategy.",
              "stories": [
                "operators"
              ]
            },
            {
              "name": "abs",
              "text": "The builtin function `abs` is defined naively as: `if . < 0 then - . else . end`.",
              "stories": [
                "numeric"
              ]
            },
            {
              "name": "length",
              "text": "The builtin function `length` gets the length of various\ndifferent types of value:\n\n- The length of a **string** is the number of Unicode\n  codepoints it contains (which will be the same as its\n  JSON-encoded length in bytes if it's pure ASCII).\n\n- The length of a **number** is its absolute value.\n\n- The length of an **array** is the number of elements.\n\n- The length of an **object** is the number of key-value pairs.\n\n- The length of **null** is zero.\n\n- It is an error to use `length` on a **boolean**.",
              "stories": [
                "collection-builtins",
                "strings"
              ]
            },
            {
              "name": "utf8-byte-length",
              "text": "The builtin function `utf8bytelength` outputs the number of\nbytes used to encode a string in UTF-8.",
              "stories": [
                "strings"
              ]
            },
            {
              "name": "keys",
              "text": "The builtin function `keys`, when given an object, returns\nits keys in an array.\n\nThe keys are sorted \"alphabetically\", by unicode codepoint\norder. This is not an order that makes particular sense in\nany particular language, but you can count on it being the\nsame for any two objects with the same set of keys,\nregardless of locale settings.\n\nWhen `keys` is given an array, it returns the valid indices\nfor that array: the integers from 0 to length-1.\n\nThe `keys_unsorted` function is just like `keys`, but if\nthe input is an object then the keys will not be sorted,\ninstead the keys will roughly be in insertion order.",
              "stories": [
                "collection-builtins"
              ]
            },
            {
              "name": "has",
              "text": "The builtin function `has` returns whether the input object\nhas the given key, or the input array has an element at the\ngiven index.",
              "stories": [
                "collection-builtins"
              ]
            },
            {
              "name": "in",
              "text": "The builtin function `in` returns whether or not the input key is in the\ngiven object, or the input index corresponds to an element\nin the given array. It is, essentially, an inversed version\nof `has`.",
              "stories": [
                "collection-builtins"
              ]
            },
            {
              "name": "map",
              "text": "For any filter `f`, `map(f)` and `map_values(f)` apply `f`\nto each of the values in the input array or object, that is,\nto the values of `.[]`.\n\nIn the absence of errors, `map(f)` always outputs an array\nwhereas `map_values(f)` outputs an array if given an array,\nor an object if given an object.\n\nWhen the input to `map_values(f)` is an object, the output\nobject has the same keys as the input object except for\nthose keys whose values when piped to `f` produce no values\nat all.\n\nThe key difference between `map(f)` and `map_values(f)` is\nthat the former simply forms an array from all the values of\n`($x|f)` for each value, `$x`, in the input array or object,\nbut `map_values(f)` only uses `first($x|f)`.",
              "stories": [
                "collection-builtins"
              ]
            },
            {
              "name": "pick",
              "text": "Emit the projection of the input object or array defined by the\nspecified sequence of path expressions, such that if `p` is any\none of these specifications, then `(. | p)` will evaluate to the\nsame value as `(. | pick(pathexps) | p)`. For arrays, negative\nindices and `.[m:n]` specifications should not be used.",
              "stories": [
                "paths",
                "collection-builtins"
              ]
            },
            {
              "name": "path",
              "text": "Outputs array representations of the given path expression\nin `.`.  The outputs are arrays of strings (object keys)\nand/or numbers (array indices).\n\nPath expressions are jq expressions like `.a`, but also `.[]`.\nThere are two types of path expressions: ones that can match\nexactly, and ones that cannot.  For example, `.a.b.c` is an\nexact match path expression, while `.a[].b` is not.\n\n`path(exact_path_expression)` will produce the array\nrepresentation of the path expression even if it does not\nexist in `.`, if `.` is `null` or an array or an object.\n\n`path(pattern)` will produce array representations of the\npaths matching `pattern` if the paths exist in `.`.",
              "stories": [
                "paths"
              ]
            },
            {
              "name": "del",
              "text": "The builtin function `del` removes a key and its corresponding\nvalue from an object.",
              "stories": [
                "paths",
                "assignment"
              ]
            },
            {
              "name": "getpath",
              "text": "The builtin function `getpath` outputs the values in `.` found\nat each path in `PATHS`.",
              "stories": [
                "paths"
              ]
            },
            {
              "name": "setpath",
              "text": "The builtin function `setpath` sets the `PATHS` in `.` to `VALUE`.",
              "stories": [
                "paths",
                "assignment"
              ]
            },
            {
              "name": "delpaths",
              "text": "The builtin function `delpaths` deletes the `PATHS` in `.`.\n`PATHS` must be an array of paths, where each path is an array\nof strings and numbers.",
              "stories": [
                "paths",
                "assignment"
              ]
            },
            {
              "name": "entries",
              "text": "These functions convert between an object and an array of\nkey-value pairs. If `to_entries` is passed an object, then\nfor each `k: v` entry in the input, the output array\nincludes `{\"key\": k, \"value\": v}`.\n\n`from_entries` does the opposite conversion, and `with_entries(f)`\nis a shorthand for `to_entries | map(f) | from_entries`, useful for\ndoing some operation to all keys and values of an object.\n`from_entries` accepts `\"key\"`, `\"Key\"`, `\"name\"`, `\"Name\"`,\n`\"value\"`, and `\"Value\"` as keys.",
              "stories": [
                "collection-builtins"
              ]
            },
            {
              "name": "select",
              "text": "The function `select(f)` produces its input unchanged if\n`f` returns true for that input, and produces no output\notherwise.",
              "stories": [
                "control"
              ]
            },
            {
              "name": "type-selectors",
              "text": "These built-ins select only inputs that are arrays, objects,\niterables (arrays or objects), booleans, numbers, normal\nnumbers, finite numbers, strings, null, non-null values, and\nnon-iterables, respectively.",
              "stories": [
                "conversion"
              ]
            },
            {
              "name": "empty",
              "text": "`empty` returns no results. None at all. Not even `null`.",
              "stories": [
                "core"
              ]
            },
            {
              "name": "error",
              "text": "Produces an error with the input value, or with the message\ngiven as the argument. Errors can be caught with try/catch;\nsee below.",
              "stories": [
                "control"
              ]
            },
            {
              "name": "halt",
              "text": "Stops the jq program with no further outputs.  jq will exit\nwith exit status `0`.",
              "stories": [
                "control",
                "io"
              ]
            },
            {
              "name": "halt-error",
              "text": "Stops the jq program with no further outputs.  The input will\nbe printed on `stderr` as raw output (i.e., strings will not\nhave double quotes) with no decoration, not even a newline.\n\nThe given `exit_code` (defaulting to `5`) will be jq's exit\nstatus.",
              "stories": [
                "control",
                "io"
              ]
            },
            {
              "name": "source-location",
              "text": "Produces an object with a \"file\" key and a \"line\" key, with\nthe filename and line number where `$__loc__` occurs, as\nvalues.",
              "stories": [
                "lexer",
                "parser",
                "io"
              ]
            },
            {
              "name": "paths",
              "text": "`paths` outputs the paths to all the elements in its input\n(except it does not output the empty list, representing .\nitself).\n\n`paths(f)` outputs the paths to any values for which `f` is `true`.\nThat is, `paths(type == \"number\")` outputs the paths to all numeric\nvalues.",
              "stories": [
                "paths",
                "traversal"
              ]
            },
            {
              "name": "add",
              "text": "The filter `add` takes as input an array, and produces as\noutput the elements of the array added together. This might\nmean summed, concatenated or merged depending on the types\nof the elements of the input array - the rules are the same\nas those for the `+` operator (described above).\n\nIf the input is an empty array, `add` returns `null`.\n\n`add(generator)` operates on the given generator rather than\nthe input.",
              "stories": [
                "collection-builtins"
              ]
            },
            {
              "name": "any",
              "text": "The filter `any` takes as input an array of boolean values,\nand produces `true` as output if any of the elements of\nthe array are `true`.\n\nIf the input is an empty array, `any` returns `false`.\n\nThe `any(condition)` form applies the given condition to the\nelements of the input array.\n\nThe `any(generator; condition)` form applies the given\ncondition to all the outputs of the given generator.",
              "stories": [
                "collection-builtins",
                "loops"
              ]
            },
            {
              "name": "all",
              "text": "The filter `all` takes as input an array of boolean values,\nand produces `true` as output if all of the elements of\nthe array are `true`.\n\nThe `all(condition)` form applies the given condition to the\nelements of the input array.\n\nThe `all(generator; condition)` form applies the given\ncondition to all the outputs of the given generator.\n\nIf the input is an empty array, `all` returns `true`.",
              "stories": [
                "collection-builtins",
                "loops"
              ]
            },
            {
              "name": "flatten",
              "text": "The filter `flatten` takes as input an array of nested arrays,\nand produces a flat array in which all arrays inside the original\narray have been recursively replaced by their values. You can pass\nan argument to it to specify how many levels of nesting to flatten.",
              "stories": [
                "collection-builtins"
              ]
            },
            {
              "name": "range",
              "text": "The `range` function produces a range of numbers. `range(4; 10)`\nproduces 6 numbers, from 4 (inclusive) to 10 (exclusive). The numbers\nare produced as separate outputs. Use `[range(4; 10)]` to get a range as\nan array.\n\nThe one argument form generates numbers from 0 to the given\nnumber, with an increment of 1.\n\nThe two argument form generates numbers from `from` to `upto`\nwith an increment of 1.\n\nThe three argument form generates numbers `from` to `upto`\nwith an increment of `by`.",
              "stories": [
                "loops"
              ]
            },
            {
              "name": "floor",
              "text": "The `floor` function returns the floor of its numeric input.",
              "stories": [
                "numeric"
              ]
            },
            {
              "name": "sqrt",
              "text": "The `sqrt` function returns the square root of its numeric input.",
              "stories": [
                "numeric"
              ]
            },
            {
              "name": "tonumber",
              "text": "The `tonumber` function parses its input as a number. It\nwill convert correctly-formatted strings to their numeric\nequivalent, leave numbers alone, and give an error on all other input.",
              "stories": [
                "conversion"
              ]
            },
            {
              "name": "toboolean",
              "text": "The `toboolean` function parses its input as a boolean. It\nwill convert correctly-formatted strings to their boolean\nequivalent, leave booleans alone, and give an error on all other input.",
              "stories": [
                "conversion"
              ]
            },
            {
              "name": "tostring",
              "text": "The `tostring` function prints its input as a\nstring. Strings are left unchanged, and all other values are\nJSON-encoded.",
              "stories": [
                "conversion"
              ]
            },
            {
              "name": "type",
              "text": "The `type` function returns the type of its argument as a\nstring, which is one of null, boolean, number, string, array\nor object.",
              "stories": [
                "conversion"
              ]
            },
            {
              "name": "numeric-special-values",
              "text": "Some arithmetic operations can yield infinities and \"not a\nnumber\" (NaN) values.  The `isinfinite` builtin returns `true`\nif its input is infinite.  The `isnan` builtin returns `true`\nif its input is a NaN.  The `infinite` builtin returns a\npositive infinite value.  The `nan` builtin returns a NaN.\nThe `isnormal` builtin returns true if its input is a normal\nnumber.",
              "stories": [
                "numeric"
              ]
            },
            {
              "name": "sort",
              "text": "The `sort` functions sorts its input, which must be an\narray. Values are sorted in the following order:\n\n* `null`\n* `false`\n* `true`\n* numbers\n* strings, in alphabetical order (by unicode codepoint value)\n* arrays, in lexical order\n* objects\n\nThe ordering for objects is a little complex: first they're\ncompared by comparing their sets of keys (as arrays in\nsorted order), and if their keys are equal then the values\nare compared key by key.\n\n`sort_by` may be used to sort by a particular field of an\nobject, or by applying any jq filter. `sort_by(f)` compares\ntwo elements by comparing the result of `f` on each element.\nWhen `f` produces multiple values, it firstly compares the\nfirst values, and the second values if the first values are\nequal, and so on.",
              "stories": [
                "collection-builtins",
                "operators"
              ]
            },
            {
              "name": "group-by",
              "text": "`group_by(.foo)` takes as input an array, groups the\nelements having the same `.foo` field into separate arrays,\nand produces all of these arrays as elements of a larger\narray, sorted by the value of the `.foo` field.\n\nAny jq expression, not just a field access, may be used in\nplace of `.foo`. The sorting order is the same as described\nin the `sort` function above.",
              "stories": [
                "collection-builtins"
              ]
            },
            {
              "name": "min-max",
              "text": "Find the minimum or maximum element of the input array.\n\nThe `min_by(path_exp)` and `max_by(path_exp)` functions allow\nyou to specify a particular field or property to examine, e.g.\n`min_by(.foo)` finds the object with the smallest `foo` field.",
              "stories": [
                "collection-builtins"
              ]
            },
            {
              "name": "unique",
              "text": "The `unique` function takes as input an array and produces\nan array of the same elements, in sorted order, with\nduplicates removed.\n\nThe `unique_by(path_exp)` function will keep only one element\nfor each value obtained by applying the argument. Think of it\nas making an array by taking one element out of every group\nproduced by `group`.",
              "stories": [
                "collection-builtins"
              ]
            },
            {
              "name": "reverse",
              "text": "This function reverses an array.",
              "stories": [
                "collection-builtins"
              ]
            },
            {
              "name": "contains",
              "text": "The filter `contains(b)` will produce true if b is\ncompletely contained within the input. A string B is\ncontained in a string A if B is a substring of A. An array B\nis contained in an array A if all elements in B are\ncontained in any element in A. An object B is contained in\nobject A if all of the values in B are contained in the\nvalue in A with the same key. All other types are assumed to\nbe contained in each other if they are equal.",
              "stories": [
                "collection-builtins",
                "strings"
              ]
            },
            {
              "name": "indices",
              "text": "Outputs an array containing the indices in `.` where `s`\noccurs.  The input may be an array, in which case if `s` is an\narray then the indices output will be those where all elements\nin `.` match those of `s`.",
              "stories": [
                "collection-builtins",
                "strings"
              ]
            },
            {
              "name": "index-rindex",
              "text": "Outputs the index of the first (`index`) or last (`rindex`)\noccurrence of `s` in the input.",
              "stories": [
                "collection-builtins",
                "strings"
              ]
            },
            {
              "name": "inside",
              "text": "The filter `inside(b)` will produce true if the input is\ncompletely contained within b. It is, essentially, an\ninversed version of `contains`.",
              "stories": [
                "collection-builtins",
                "strings"
              ]
            },
            {
              "name": "startswith",
              "text": "Outputs `true` if . starts with the given string argument.",
              "stories": [
                "strings"
              ]
            },
            {
              "name": "endswith",
              "text": "Outputs `true` if . ends with the given string argument.",
              "stories": [
                "strings"
              ]
            },
            {
              "name": "combinations",
              "text": "Outputs all combinations of the elements of the arrays in the\ninput array. If given an argument `n`, it outputs all combinations\nof `n` repetitions of the input array.",
              "stories": [
                "collection-builtins"
              ]
            },
            {
              "name": "ltrimstr",
              "text": "Outputs its input with the given prefix string removed, if it\nstarts with it.",
              "stories": [
                "strings"
              ]
            },
            {
              "name": "rtrimstr",
              "text": "Outputs its input with the given suffix string removed, if it\nends with it.",
              "stories": [
                "strings"
              ]
            },
            {
              "name": "trimstr",
              "text": "Outputs its input with the given string removed at both ends, if it\nstarts or ends with it.",
              "stories": [
                "strings"
              ]
            },
            {
              "name": "trim-whitespace",
              "text": "`trim` trims both leading and trailing whitespace.\n\n`ltrim` trims only leading (left side) whitespace.\n\n`rtrim` trims only trailing (right side) whitespace.\n\nWhitespace characters are the usual `\" \"`, `\"\\n\"` `\"\\t\"`, `\"\\r\"`\nand also all characters in the Unicode character database with the\nwhitespace property. Note that what considers whitespace might\nchange in the future.",
              "stories": [
                "strings"
              ]
            },
            {
              "name": "explode",
              "text": "Converts an input string into an array of the string's\ncodepoint numbers.",
              "stories": [
                "strings"
              ]
            },
            {
              "name": "implode",
              "text": "The inverse of explode.",
              "stories": [
                "strings"
              ]
            },
            {
              "name": "split",
              "text": "Splits an input string on the separator argument.\n\n`split` can also split on regex matches when called with\ntwo arguments (see the regular expressions section below).",
              "stories": [
                "strings"
              ]
            },
            {
              "name": "join",
              "text": "Joins the array of elements given as input, using the\nargument as separator. It is the inverse of `split`: that is,\nrunning `split(\"foo\") | join(\"foo\")` over any input string\nreturns said input string.\n\nNumbers and booleans in the input are converted to strings.\nNull values are treated as empty strings. Arrays and objects\nin the input are not supported.",
              "stories": [
                "strings"
              ]
            },
            {
              "name": "ascii-case",
              "text": "Emit a copy of the input string with its alphabetic characters (a-z and A-Z)\nconverted to the specified case.",
              "stories": [
                "strings"
              ]
            },
            {
              "name": "while",
              "text": "The `while(cond; update)` function allows you to repeatedly\napply an update to `.` until `cond` is false.",
              "stories": [
                "loops"
              ]
            },
            {
              "name": "repeat",
              "text": "The `repeat(exp)` function allows you to repeatedly\napply expression `exp` to `.` until an error is raised.",
              "stories": [
                "loops"
              ]
            },
            {
              "name": "until",
              "text": "The `until(cond; next)` function allows you to repeatedly\napply the expression `next`, initially to `.` then to its own\noutput, until `cond` is true.",
              "stories": [
                "loops"
              ]
            },
            {
              "name": "recurse",
              "text": "When called without an argument, `recurse` is equivalent to\n`recurse(.[]?)`.\n\n`recurse(f)` is identical to `recurse(f; true)` and can be\nused without concerns about recursion depth.\n\n`recurse(f; condition)` is a generator which begins by\nemitting . and then emits in turn .|f, .|f|f, .|f|f|f, ...  so long\nas the computed value satisfies the condition.",
              "stories": [
                "traversal",
                "loops"
              ]
            },
            {
              "name": "walk",
              "text": "The `walk(f)` function applies f recursively to every\ncomponent of the input entity.  When an array is\nencountered, f is first applied to its elements and then to\nthe array itself; when an object is encountered, f is first\napplied to all the values and then to the object.",
              "stories": [
                "traversal"
              ]
            },
            {
              "name": "have-literal-numbers",
              "text": "This builtin returns true if jq's build configuration\nincludes support for preservation of input number literals.",
              "stories": [
                "numeric"
              ]
            },
            {
              "name": "have-decnum",
              "text": "This builtin returns true if jq was built with \"decnum\",\nwhich is the current literal number preserving numeric\nbackend implementation for jq.",
              "stories": [
                "numeric"
              ]
            },
            {
              "name": "build-configuration",
              "text": "This builtin binding shows the jq executable's build\nconfiguration.  Its value has no particular format, but\nit can be expected to be at least the `./configure`\ncommand-line arguments, and may be enriched in the\nfuture to include the version strings for the build\ntooling used.",
              "stories": [
                "io"
              ]
            },
            {
              "name": "environment",
              "text": "`$ENV` is an object representing the environment variables as\nset when the jq program started.\n\n`env` outputs an object representing jq's current environment.",
              "stories": [
                "io"
              ]
            },
            {
              "name": "transpose",
              "text": "Transpose a possibly jagged matrix (an array of arrays).\nRows are padded with nulls so the result is always rectangular.",
              "stories": [
                "collection-builtins"
              ]
            },
            {
              "name": "bsearch",
              "text": "`bsearch(x)` conducts a binary search for x in the input\narray.  If the input is sorted and contains x, then\n`bsearch(x)` will return its index in the array; otherwise, if\nthe array is sorted, it will return (-1 - ix) where ix is an\ninsertion point such that the array would still be sorted\nafter the insertion of x at ix.  If the array is not sorted,\n`bsearch(x)` will return an integer that is probably of no\ninterest.",
              "stories": [
                "collection-builtins"
              ]
            },
            {
              "name": "string-interpolation",
              "text": "Inside a string, you can put an expression inside parens\nafter a backslash. Whatever the expression returns will be\ninterpolated into the string.",
              "stories": [
                "lexer",
                "parser",
                "strings"
              ]
            },
            {
              "name": "json-conversion",
              "text": "The `tojson` and `fromjson` builtins dump values as JSON texts\nor parse JSON texts into values, respectively.  The `tojson`\nbuiltin differs from `tostring` in that `tostring` returns strings\nunmodified, while `tojson` encodes strings as JSON strings.",
              "stories": [
                "conversion"
              ]
            },
            {
              "name": "format-strings",
              "text": "The `@foo` syntax is used to format and escape strings,\nwhich is useful for building URLs, documents in a language\nlike HTML or XML, and so forth. `@foo` can be used as a\nfilter on its own, the possible escapings are:\n\n* `@text`:\n\n  Calls `tostring`, see that function for details.\n\n* `@json`:\n\n  Serializes the input as JSON.\n\n* `@html`:\n\n  Applies HTML/XML escaping, by mapping the characters\n  `<>&'\"` to their entity equivalents `&lt;`, `&gt;`,\n  `&amp;`, `&apos;`, `&quot;`.\n\n* `@uri`:\n\n  Applies percent-encoding, by mapping all reserved URI\n  characters to a `%XX` sequence.\n\n* `@urid`:\n\n  The inverse of `@uri`, applies percent-decoding, by mapping\n  all `%XX` sequences to their corresponding URI characters.\n\n* `@csv`:\n\n  The input must be an array, and it is rendered as CSV\n  with double quotes for strings, and quotes escaped by\n  repetition.\n\n* `@tsv`:\n\n  The input must be an array, and it is rendered as TSV\n  (tab-separated values). Each input array will be printed as\n  a single line. Fields are separated by a single\n  tab (ascii `0x09`). Input characters line-feed (ascii `0x0a`),\n  carriage-return (ascii `0x0d`), tab (ascii `0x09`) and\n  backslash (ascii `0x5c`) will be output as escape sequences\n  `\\n`, `\\r`, `\\t`, `\\\\` respectively.\n\n* `@sh`:\n\n  The input is escaped suitable for use in a command-line\n  for a POSIX shell. If the input is an array, the output\n  will be a series of space-separated strings.\n\n* `@base64`:\n\n  The input is converted to base64 as specified by RFC 4648.\n\n* `@base64d`:\n\n  The inverse of `@base64`, input is decoded as specified by RFC 4648.\n  Note\\: If the decoded string is not UTF-8, the results are undefined.",
              "stories": [
                "lexer",
                "parser",
                "formats"
              ]
            },
            {
              "name": "format-interpolation",
              "text": "This syntax can be combined with string interpolation in a\nuseful way. You can follow a `@foo` token with a string\nliteral. The contents of the string literal will *not* be\nescaped. However, all interpolations made inside that string\nliteral will be escaped.",
              "stories": [
                "lexer",
                "parser",
                "formats"
              ]
            },
            {
              "name": "date-builtins",
              "text": "The `fromdateiso8601` builtin parses datetimes in the ISO 8601\nformat to a number of seconds since the Unix epoch\n(1970-01-01T00:00:00Z).  The `todateiso8601` builtin does the\ninverse.\n\nThe `fromdate` builtin parses datetime strings.  Currently\n`fromdate` only supports ISO 8601 datetime strings, but in the\nfuture it will attempt to parse datetime strings in more\nformats.\n\nThe `todate` builtin is an alias for `todateiso8601`.\n\nThe `now` builtin outputs the current time, in seconds since\nthe Unix epoch.",
              "stories": [
                "dates"
              ]
            },
            {
              "name": "low-level-date-builtins",
              "text": "Low-level jq interfaces to the C-library time functions are\nalso provided: `strptime`, `strftime`, `strflocaltime`,\n`mktime`, `gmtime`, and `localtime`.",
              "stories": [
                "dates"
              ]
            },
            {
              "name": "sql-index",
              "text": "This builtin produces an object whose keys are computed by\nthe given index expression applied to each value from the\ngiven stream.",
              "stories": [
                "sql"
              ]
            },
            {
              "name": "sql-join",
              "text": "This builtin joins the values from the given stream to the\ngiven index.  The index's keys are computed by applying the\ngiven index expression to each value from the given stream.\nAn array of the value in the stream and the corresponding\nvalue from the index is fed to the given join expression to\nproduce each result.",
              "stories": [
                "sql"
              ]
            },
            {
              "name": "sql-in",
              "text": "* `IN(s)`:\n\n  This builtin outputs `true` if `.` appears in the given\n  stream, otherwise it outputs `false`.\n\n* `IN(source; s)`:\n\n  This builtin outputs `true` if any value in the source stream\n  appears in the second stream, otherwise it outputs `false`.",
              "stories": [
                "sql"
              ]
            },
            {
              "name": "builtins-inventory",
              "text": "Returns a list of all builtin functions in the format `name/arity`.\nSince functions with the same name but different arities are considered\nseparate functions, `all/0`, `all/1`, and `all/2` would all be present\nin the list.",
              "stories": [
                "sql"
              ]
            },
            {
              "name": "equality",
              "text": "The expression 'a == b' will produce 'true' if the results of evaluating\na and b are equal (that is, if they represent equivalent JSON values) and\n'false' otherwise. In particular, strings are never considered equal\nto numbers.  In checking for the equality of JSON objects, the ordering of keys\nis irrelevant.  If you're coming from JavaScript, please note that jq's `==` is like\nJavaScript's `===`, the \"strict equality\" operator.\n\n!= is \"not equal\", and 'a != b' returns the opposite value of 'a == b'",
              "stories": [
                "operators"
              ]
            },
            {
              "name": "conditionals",
              "text": "`if A then B else C end` will act the same as `B` if `A`\nproduces a value other than false or null, but act the same\nas `C` otherwise.\n\n`if A then B end` is the same as `if A then B else .  end`.\nThat is, the `else` branch is optional, and if absent is the\nsame as `.`. This also applies to `elif` with absent ending `else` branch.",
              "stories": [
                "parser",
                "control"
              ]
            },
            {
              "name": "conditional-generators",
              "text": "If the condition `A` produces multiple results, then `B` is evaluated\nonce for each result that is not false or null, and `C` is evaluated\nonce for each false or null.\n\nMore cases can be added to an if using `elif A then B` syntax.",
              "stories": [
                "control"
              ]
            },
            {
              "name": "comparisons",
              "text": "The comparison operators `>`, `>=`, `<=`, `<` return whether\ntheir left argument is greater than, greater than or equal\nto, less than or equal to or less than their right argument\n(respectively).\n\nThe ordering is the same as that described for `sort`, above.",
              "stories": [
                "operators"
              ]
            },
            {
              "name": "boolean-operators",
              "text": "jq supports the normal Boolean operators `and`, `or`, `not`.\nThey have the same standard of truth as if expressions -\n`false` and `null` are considered \"false values\", and\nanything else is a \"true value\".\n\nIf an operand of one of these operators produces multiple\nresults, the operator itself will produce a result for each input.\n\n`not` is in fact a builtin function rather than an operator,\nso it is called as a filter to which things can be piped\nrather than with special syntax, as in `.foo and .bar |\nnot`.",
              "stories": [
                "parser",
                "operators",
                "control"
              ]
            },
            {
              "name": "alternative",
              "text": "The `//` operator produces all the values of its left-hand\nside that are neither `false` nor `null`. If the\nleft-hand side produces no values other than `false` or\n`null`, then `//` produces all the values of its right-hand\nside.",
              "stories": [
                "parser",
                "control"
              ]
            },
            {
              "name": "try-catch",
              "text": "Errors can be caught by using `try EXP catch EXP`.  The first\nexpression is executed, and if it fails then the second is\nexecuted with the error message.  The output of the handler,\nif any, is output as if it had been the output of the\nexpression to try.\n\nThe `try EXP` form uses `empty` as the exception handler.",
              "stories": [
                "parser",
                "control"
              ]
            },
            {
              "name": "label-break",
              "text": "jq has a syntax for named lexical labels to \"break\" or \"go (back) to\":\n\n    label $out | ... break $out ...\n\nThe `break $label_name` expression will cause the program to\nact as though the nearest (to the left) `label $label_name`\nproduced `empty`.\n\nThe relationship between the `break` and corresponding `label`\nis lexical: the label has to be \"visible\" from the break.",
              "stories": [
                "parser",
                "control"
              ]
            },
            {
              "name": "optional-operator",
              "text": "The `?` operator, used as `EXP?`, is shorthand for `try EXP`.",
              "stories": [
                "parser",
                "control"
              ]
            },
            {
              "name": "regex-syntax",
              "text": "jq uses the\n[Oniguruma regular expression library](https://github.com/kkos/oniguruma/blob/master/doc/RE),\nas do PHP, TextMate, Sublime Text, etc, so the\ndescription here will focus on jq specifics.\n\nOniguruma supports several flavors of regular expression, so it is important to know\nthat jq uses the [\"Perl NG\" (Perl with named groups)](https://github.com/kkos/oniguruma/blob/master/doc/SYNTAX.md) flavor.",
              "stories": [
                "strings"
              ]
            },
            {
              "name": "regex-flags",
              "text": "FLAGS is a string consisting of one of more of the supported flags:\n\n* `g` - Global search (find all matches, not just the first)\n* `i` - Case insensitive search\n* `m` - Multi line mode (`.` will match newlines)\n* `n` - Ignore empty matches\n* `p` - Both s and m modes are enabled\n* `s` - Single line mode (`^` -> `\\A`, `$` -> `\\Z`)\n* `l` - Find longest possible matches\n* `x` - Extended regex format (ignore whitespace and comments)",
              "stories": [
                "strings"
              ]
            },
            {
              "name": "regex-test",
              "text": "Like `match`, but does not return match objects, only `true` or `false`\nfor whether or not the regex matches the input.",
              "stories": [
                "strings"
              ]
            },
            {
              "name": "regex-match",
              "text": "**match** outputs an object for each match it finds.  Matches have\nthe following fields:\n\n* `offset` - offset in UTF-8 codepoints from the beginning of the input\n* `length` - length in UTF-8 codepoints of the match\n* `string` - the string that it matched\n* `captures` - an array of objects representing capturing groups.\n\nCapturing group objects have the following fields:\n\n* `offset` - offset in UTF-8 codepoints from the beginning of the input\n* `length` - length in UTF-8 codepoints of this capturing group\n* `string` - the string that was captured\n* `name` - the name of the capturing group (or `null` if it was unnamed)\n\nCapturing groups that did not match anything return an offset of -1",
              "stories": [
                "strings"
              ]
            },
            {
              "name": "regex-capture",
              "text": "Collects the named captures in a JSON object, with the name\nof each capture as the key, and the matched string as the\ncorresponding value.",
              "stories": [
                "strings"
              ]
            },
            {
              "name": "regex-scan",
              "text": "Emit a stream of the non-overlapping substrings of the input\nthat match the regex in accordance with the flags, if any\nhave been specified.  If there is no match, the stream is empty.\nTo capture all the matches for each input string, use the idiom\n`[ expr ]`, e.g. `[ scan(regex) ]`.  If the regex contains capturing\ngroups, the filter emits a stream of arrays, each of which contains\nthe captured strings.",
              "stories": [
                "strings"
              ]
            },
            {
              "name": "regex-split",
              "text": "Splits an input string on each regex match.\n\nFor backwards compatibility, when called with a single argument,\n`split` splits on a string, not a regex.",
              "stories": [
                "strings"
              ]
            },
            {
              "name": "regex-splits",
              "text": "These provide the same results as their `split` counterparts,\nbut as a stream instead of an array.",
              "stories": [
                "strings"
              ]
            },
            {
              "name": "regex-sub",
              "text": "Emit the string obtained by replacing the first match of\nregex in the input string with `tostring`, after\ninterpolation.  `tostring` should be a jq string or a stream\nof such strings, each of which may contain references to\nnamed captures. The named captures are, in effect, presented\nas a JSON object (as constructed by `capture`) to\n`tostring`, so a reference to a captured variable named \"x\"\nwould take the form: `\"\\(.x)\"`.",
              "stories": [
                "strings"
              ]
            },
            {
              "name": "regex-gsub",
              "text": "`gsub` is like `sub` but all the non-overlapping occurrences of the regex are\nreplaced by `tostring`, after interpolation. If the second argument is a stream\nof jq strings, then `gsub` will produce a corresponding stream of JSON strings.",
              "stories": [
                "strings"
              ]
            },
            {
              "name": "variable-binding",
              "text": "The expression `exp as $x | ...` means: for each value of expression\n`exp`, run the rest of the pipeline with the entire original input, and\nwith `$x` set to that value.  Thus `as` functions as something of a\nforeach loop.",
              "stories": [
                "parser",
                "bindings"
              ]
            },
            {
              "name": "destructuring",
              "text": "Multiple variables may be declared using a single `as` expression by\nproviding a pattern that matches the structure of the input\n(this is known as \"destructuring\"):\n\n    . as {realnames: $names, posts: [$first, $second]} | ...\n\nThe variable declarations in array patterns (e.g., `. as\n[$first, $second]`) bind to the elements of the array in from\nthe element at index zero on up, in order.  When there is no\nvalue at the index for an array pattern element, `null` is\nbound to that variable.",
              "stories": [
                "parser",
                "bindings"
              ]
            },
            {
              "name": "destructuring-alternative",
              "text": "The destructuring alternative operator provides a concise mechanism\nfor destructuring an input that can take one of several forms.",
              "stories": [
                "parser",
                "bindings"
              ]
            },
            {
              "name": "destructuring-alternative-bindings",
              "text": "Each alternative need not define all of the same variables, but all named\nvariables will be available to the subsequent expression. Variables not\nmatched in the alternative that succeeded will be `null`:",
              "stories": [
                "bindings"
              ]
            },
            {
              "name": "destructuring-alternative-errors",
              "text": "Additionally, if the subsequent expression returns an error, the\nalternative operator will attempt to try the next binding. Errors\nthat occur during the final alternative are passed through.",
              "stories": [
                "bindings",
                "control"
              ]
            },
            {
              "name": "function-definitions",
              "text": "You can give a filter a name using \"def\" syntax:\n\n    def increment: . + 1;\n\nFrom then on, `increment` is usable as a filter just like a\nbuiltin function (in fact, this is how many of the builtins\nare defined). A function may take arguments:\n\n    def map(f): [.[] | f];\n\nArguments are passed as _filters_ (functions with no\narguments), _not_ as values. The same argument may be\nreferenced multiple times with different inputs (here `f` is\nrun for each element of the input array).",
              "stories": [
                "parser",
                "bindings"
              ]
            },
            {
              "name": "function-value-arguments",
              "text": "If you want the value-argument behaviour for defining simple\nfunctions, you can just use a variable:\n\n    def addvalue(f): f as $f | map(. + $f);\n\nOr use the short-hand:\n\n    def addvalue($f): ...;",
              "stories": [
                "parser",
                "bindings"
              ]
            },
            {
              "name": "function-redefinition",
              "text": "Multiple definitions using the same function name are allowed.\nEach re-definition replaces the previous one for the same\nnumber of function arguments, but only for references from\nfunctions (or main program) subsequent to the re-definition.",
              "stories": [
                "bindings"
              ]
            },
            {
              "name": "lexical-scoping",
              "text": "There are two types of symbols in jq: value bindings (a.k.a.,\n\"variables\"), and functions.  Both are scoped lexically,\nwith expressions being able to refer only to symbols that\nhave been defined \"to the left\" of them.  The only exception\nto this rule is that functions can refer to themselves so as\nto be able to create recursive functions.",
              "stories": [
                "parser",
                "bindings"
              ]
            },
            {
              "name": "isempty",
              "text": "Returns true if `exp` produces no outputs, false otherwise.",
              "stories": [
                "loops"
              ]
            },
            {
              "name": "limit",
              "text": "The `limit` function extracts up to `n` outputs from `expr`.",
              "stories": [
                "loops"
              ]
            },
            {
              "name": "skip",
              "text": "The `skip` function skips the first `n` outputs from `expr`.",
              "stories": [
                "loops"
              ]
            },
            {
              "name": "generator-first-last-nth",
              "text": "The `first(expr)` and `last(expr)` functions extract the first\nand last values from `expr`, respectively.\n\nThe `nth(n; expr)` function extracts the nth value output by `expr`.\nNote that `nth(n; expr)` doesn't support negative values of `n`.",
              "stories": [
                "loops"
              ]
            },
            {
              "name": "array-first-last-nth",
              "text": "The `first` and `last` functions extract the first\nand last values from any array at `.`.\n\nThe `nth(n)` function extracts the nth value of any array at `.`.",
              "stories": [
                "collection-builtins"
              ]
            },
            {
              "name": "reduce",
              "text": "The `reduce` syntax allows you to combine all of the results of\nan expression by accumulating them into a single answer.\nThe form is `reduce EXP as $var (INIT; UPDATE)`.",
              "stories": [
                "parser",
                "loops",
                "bindings"
              ]
            },
            {
              "name": "foreach",
              "text": "The `foreach` syntax is similar to `reduce`, but intended to\nallow the construction of `limit` and reducers that produce\nintermediate results.\n\nThe form is `foreach EXP as $var (INIT; UPDATE; EXTRACT)`.",
              "stories": [
                "parser",
                "loops",
                "bindings"
              ]
            },
            {
              "name": "foreach-default-extract",
              "text": "When `EXTRACT` is omitted, the identity filter is used.\nThat is, it outputs the intermediate values as they are.",
              "stories": [
                "loops"
              ]
            },
            {
              "name": "tail-recursion",
              "text": "Tail calls are optimized whenever the expression to the left of\nthe recursive call outputs its last value.  In practice this\nmeans that the expression to the left of the recursive call\nshould not produce more than one output for each input.",
              "stories": [
                "bindings",
                "loops"
              ]
            },
            {
              "name": "math-functions",
              "text": "Besides simple arithmetic operators such as `+`, jq also has most\nstandard math functions from the C math library.  C math functions\nthat take a single input argument (e.g., `sin()`) are available as\nzero-argument jq functions.  C math functions that take two input\narguments (e.g., `pow()`) are available as two-argument jq\nfunctions that ignore `.`.  C math functions that take three input\narguments are available as three-argument jq functions that ignore\n`.`.\n\nAvailability of standard math functions depends on the\navailability of the corresponding math functions in your operating\nsystem and C math library.  Unavailable math functions will be\ndefined but will raise an error.",
              "stories": [
                "numeric"
              ]
            },
            {
              "name": "input",
              "text": "Outputs one new input.",
              "stories": [
                "io"
              ]
            },
            {
              "name": "inputs",
              "text": "Outputs all remaining inputs, one by one.",
              "stories": [
                "io"
              ]
            },
            {
              "name": "debug",
              "text": "These two filters are like `.` but have as a side-effect the\nproduction of one or more messages on stderr.\n\nThe message produced by the `debug` filter has the form\n\n    [\"DEBUG:\",<input-value>]\n\nwhere `<input-value>` is a compact rendition of the input\nvalue.  This format may change in the future.\n\nThe `debug(msgs)` filter is defined as `(msgs | debug | empty), .`\nthus allowing great flexibility in the content of the message,\nwhile also allowing multi-line debugging statements to be created.",
              "stories": [
                "io"
              ]
            },
            {
              "name": "stderr",
              "text": "Prints its input in raw and compact mode to stderr with no\nadditional decoration, not even a newline.",
              "stories": [
                "io"
              ]
            },
            {
              "name": "input-filename",
              "text": "Returns the name of the file whose input is currently being\nfiltered.  Note that this will not work well unless jq is\nrunning in a UTF-8 locale.",
              "stories": [
                "io"
              ]
            },
            {
              "name": "input-line-number",
              "text": "Returns the line number of the input currently being filtered.",
              "stories": [
                "io"
              ]
            },
            {
              "name": "truncate-stream",
              "text": "Consumes a number as input and truncates the corresponding\nnumber of path elements from the left of the outputs of the\ngiven streaming expression.",
              "stories": [
                "traversal"
              ]
            },
            {
              "name": "fromstream",
              "text": "Outputs values corresponding to the stream expression's\noutputs.",
              "stories": [
                "traversal"
              ]
            },
            {
              "name": "tostream",
              "text": "The `tostream` builtin outputs the streamed form of its input.",
              "stories": [
                "traversal"
              ]
            },
            {
              "name": "assignment-paths",
              "text": "All the assignment operators in jq have path expressions on the\nleft-hand side (LHS).  The right-hand side (RHS) provides values\nto set to the paths named by the LHS path expressions.\n\nValues in jq are always immutable.  Internally, assignment works\nby using a reduction to compute new, replacement values for `.` that\nhave had all the desired assignments applied to `.`, then\noutputting the modified value.",
              "stories": [
                "parser",
                "paths",
                "assignment"
              ]
            },
            {
              "name": "update-assignment",
              "text": "This is the \"update\" operator `|=`.  It takes a filter on the\nright-hand side and works out the new value for the property\nof `.` being assigned to by running the old value through this\nexpression. For instance, `(.foo, .bar) |= .+1` will build an\nobject with the `foo` field set to the input's `foo` plus 1,\nand the `bar` field set to the input's `bar` plus 1.\n\nThe left-hand side can be any general path expression; see `path()`.",
              "stories": [
                "parser",
                "assignment"
              ]
            },
            {
              "name": "update-assignment-results",
              "text": "If the right-hand side outputs no values (i.e., `empty`), then\nthe left-hand side path will be deleted, as with `del(path)`.\n\nIf the right-hand side outputs multiple values, only the first\none will be used (COMPATIBILITY NOTE: in jq 1.5 and earlier\nreleases, it used to be that only the last one was used).",
              "stories": [
                "assignment"
              ]
            },
            {
              "name": "arithmetic-update-assignment",
              "text": "jq has a few operators of the form `a op= b`, which are all\nequivalent to `a |= . op b`. So, `+= 1` can be used to\nincrement values, being the same as `|= . + 1`.",
              "stories": [
                "parser",
                "assignment",
                "operators"
              ]
            },
            {
              "name": "plain-assignment",
              "text": "This is the plain assignment operator.  Unlike the others, the\ninput to the right-hand side (RHS) is the same as the input to\nthe left-hand side (LHS) rather than the value at the LHS\npath, and all values output by the RHS will be used (as shown\nbelow).\n\nIf the RHS of `=` produces multiple values, then for each such\nvalue jq will set the paths on the left-hand side to the value\nand then it will output the modified `.`.",
              "stories": [
                "parser",
                "assignment"
              ]
            },
            {
              "name": "complex-assignment",
              "text": "When jq encounters an assignment like 'a = b', it records the \"path\"\ntaken to select a part of the input document while executing a. This\npath is then used to find which part of the input to change while\nexecuting the assignment. Any filter may be used on the\nleft-hand side of an equals - whichever paths it selects from the\ninput will be where the assignment is performed.",
              "stories": [
                "paths",
                "assignment"
              ]
            },
            {
              "name": "comments",
              "text": "A `#` character (not part of a string) starts a comment.\nAll characters from `#` to the end of the line are ignored.\n\nIf the end of the line is preceded by an odd number of backslash\ncharacters, the following line is also considered part of the\ncomment and is ignored.",
              "stories": [
                "lexer"
              ]
            },
            {
              "name": "module-search",
              "text": "Modules imported by a program are searched for in a default search\npath (see below).  The `import` and `include` directives allow the\nimporter to alter this path.\n\nPaths in the search path are subject to various substitutions.",
              "stories": [
                "parser",
                "bindings"
              ]
            },
            {
              "name": "module-import",
              "text": "Imports a module found at the given path relative to a\ndirectory in a search path.  A `.jq` suffix will be added to\nthe relative path string.  The module's symbols are prefixed\nwith `NAME::`.",
              "stories": [
                "parser",
                "bindings"
              ]
            },
            {
              "name": "module-include",
              "text": "Imports a module found at the given path relative to a\ndirectory in a search path as if it were included in place.  A\n`.jq` suffix will be added to the relative path string.  The\nmodule's symbols are imported into the caller's namespace as\nif the module's content had been included directly.",
              "stories": [
                "parser",
                "bindings"
              ]
            },
            {
              "name": "json-import",
              "text": "Imports a JSON file found at the given path relative to a\ndirectory in a search path.  A `.json` suffix will be added to\nthe relative path string.  The file's data will be available\nas `$NAME::NAME`.",
              "stories": [
                "parser",
                "bindings"
              ]
            },
            {
              "name": "module-metadata",
              "text": "This directive is entirely optional.  It's not required for\nproper operation.  It serves only the purpose of providing\nmetadata that can be read with the `modulemeta` builtin.",
              "stories": [
                "parser",
                "bindings"
              ]
            },
            {
              "name": "modulemeta",
              "text": "Takes a module name as input and outputs the module's metadata\nas an object, with the module's imports (including metadata)\nas an array value for the `deps` key and the module's defined\nfunctions as an array value for the `defs` key.",
              "stories": [
                "bindings"
              ]
            }
          ]
        }
      ]
    },
    "jq.test": {
      "state": "current",
      "versions": [
        {
          "commit": "fa3e338",
          "date": "2026-10-28",
          "hash": "329689763b651096989bd8260b643731083fc5fd17f6bd7834d158713f738cbd",
          "release": "",
          "state": "consumed",
          "via": "plan",
          "ticket": null,
          "requirements": [
            {
              "name": "test-record-format",
              "text": "# Tests are groups of three lines: program, input, expected output\n# Blank lines and lines starting with # are ignored",
              "stories": [
                "corpus-staging"
              ]
            },
            {
              "name": "parse-simple-values",
              "text": "# Simple value tests to check parser. Input is irrelevant",
              "stories": [
                "lexer",
                "parser",
                "core",
                "constructors"
              ]
            },
            {
              "name": "accept-input-byte-order-mark",
              "text": "# The input line starts with a 0xFEFF (byte order mark) codepoint\n# No, there is no reason to have a byte order mark in UTF8 text.\n# But apparently people do, so jq shouldn't break on it.",
              "stories": [
                "conversion"
              ]
            },
            {
              "name": "parse-string-escapes",
              "text": "# We test escapes by matching them against Unicode codepoints",
              "stories": [
                "lexer",
                "parser",
                "conversion"
              ]
            },
            {
              "name": "format-and-encode-values",
              "text": "@text,@json,([1,.]|@csv,@tsv),@html,(@uri|.,@urid),@sh,(@base64|.,@base64d)\n\"!()<>&'\\\"\\t\"\n\"!()<>&'\\\"\\t\"\n\"\\\"!()<>&'\\\\\\\"\\\\t\\\"\"\n\"1,\\\"!()<>&'\\\"\\\"\\t\\\"\"\n\"1\\t!()<>&'\\\"\\\\t\"\n\"!()&lt;&gt;&amp;&apos;&quot;\\t\"\n\"%21%28%29%3C%3E%26%27%22%09\"\n\"!()<>&'\\\"\\t\"\n\"'!()<>&'\\\\''\\\"\\t'\"\n\"ISgpPD4mJyIJ\"\n\"!()<>&'\\\"\\t\"",
              "stories": [
                "formats",
                "lexer",
                "parser"
              ]
            },
            {
              "name": "construct-objects",
              "text": "#\n# Dictionary construction syntax\n#",
              "stories": [
                "lexer",
                "parser",
                "constructors",
                "bindings",
                "io"
              ]
            },
            {
              "name": "access-fields-and-pipe",
              "text": "#\n# Field access, piping\n#",
              "stories": [
                "parser",
                "core",
                "constructors",
                "control",
                "traversal"
              ]
            },
            {
              "name": "assign-negative-indices",
              "text": "#\n# Negative array indices\n#",
              "stories": [
                "constructors",
                "assignment"
              ]
            },
            {
              "name": "generate-multiple-outputs",
              "text": "#\n# Multiple outputs, iteration\n#",
              "stories": [
                "parser",
                "core",
                "constructors",
                "loops",
                "bindings",
                "control"
              ]
            },
            {
              "name": "evaluate-builtin-argument-streams",
              "text": "# Check that various builtins evaluate all arguments where appropriate,\n# doing cartesian products where appropriate.",
              "stories": [
                "core",
                "loops",
                "strings",
                "collection-builtins"
              ]
            },
            {
              "name": "slice-values",
              "text": "#\n# Slices\n#",
              "stories": [
                "constructors",
                "assignment"
              ]
            },
            {
              "name": "bind-variables",
              "text": "#\n# Variables\n#",
              "stories": [
                "parser",
                "bindings",
                "constructors"
              ]
            },
            {
              "name": "evaluate-builtin-functions",
              "text": "#\n# Builtin functions\n#",
              "stories": [
                "operators",
                "conversion",
                "collection-builtins",
                "numeric"
              ]
            },
            {
              "name": "define-functions",
              "text": "#\n# User-defined functions\n# Oh god.\n#",
              "stories": [
                "parser",
                "bindings",
                "core"
              ]
            },
            {
              "name": "reduce-and-destructure",
              "text": "reduce .[] as $x (0; . + $x)\n[1,2,4]\n7",
              "stories": [
                "parser",
                "bindings",
                "loops",
                "control"
              ]
            },
            {
              "name": "evaluate-any-and-all",
              "text": "# Check short-circuiting\nany(true, error; .)\n\"badness\"\ntrue\n\nall(false, error; .)\n\"badness\"\nfalse",
              "stories": [
                "collection-builtins",
                "core"
              ]
            },
            {
              "name": "generate-and-use-paths",
              "text": "#\n# Paths\n#",
              "stories": [
                "paths",
                "assignment",
                "constructors",
                "control"
              ]
            },
            {
              "name": "assign-through-paths",
              "text": "#\n# Assignment\n#",
              "stories": [
                "assignment",
                "paths",
                "operators",
                "bindings",
                "control"
              ]
            },
            {
              "name": "evaluate-conditionals",
              "text": "#\n# Conditionals\n#",
              "stories": [
                "parser",
                "control",
                "operators",
                "assignment"
              ]
            },
            {
              "name": "catch-errors",
              "text": "# Try/catch and general `?` operator",
              "stories": [
                "parser",
                "control",
                "core"
              ]
            },
            {
              "name": "operate-on-strings",
              "text": "# string operations",
              "stories": [
                "strings",
                "operators",
                "conversion"
              ]
            },
            {
              "name": "merge-objects-recursively",
              "text": "# Test recursive object merge",
              "stories": [
                "operators"
              ]
            },
            {
              "name": "filter-by-type",
              "text": "[.[]|arrays]\n[1,2,\"foo\",[],[3,[]],{},true,false,null]\n[[],[3,[]]]",
              "stories": [
                "conversion"
              ]
            },
            {
              "name": "use-collection-utilities",
              "text": "sort\n[42,[2,5,3,11],10,{\"a\":42,\"b\":2},{\"a\":42},true,2,[2,6],\"hello\",null,[2,5,6],{\"a\":[],\"b\":1},\"abc\",\"ab\",[3,10],{},false,\"abcd\",null]\n[null,null,false,true,2,10,42,\"ab\",\"abc\",\"abcd\",\"hello\",[2,5,3,11],[2,5,6],[2,6],[3,10],{},{\"a\":42},{\"a\":42,\"b\":2},{\"a\":[],\"b\":1}]",
              "stories": [
                "collection-builtins",
                "operators",
                "strings"
              ]
            },
            {
              "name": "use-date-functions",
              "text": "strftime(\"%Y-%m-%dT%H:%M:%SZ\")\n[2015,2,5,23,51,47,4,63]\n\"2015-03-05T23:51:47Z\"",
              "stories": [
                "dates"
              ]
            },
            {
              "name": "import-modules",
              "text": "# module system",
              "stories": [
                "lexer",
                "parser",
                "bindings"
              ]
            },
            {
              "name": "use-sql-filters",
              "text": "INDEX(range(5)|[., \"foo\\(.)\"]; .[0])\nnull\n{\"0\":[0,\"foo0\"],\"1\":[1,\"foo1\"],\"2\":[2,\"foo2\"],\"3\":[3,\"foo3\"],\"4\":[4,\"foo4\"]}",
              "stories": [
                "sql"
              ]
            },
            {
              "name": "list-builtins",
              "text": "# check that dead code removal occurs after builtin it generation\nbuiltins|length > 10\nnull\ntrue",
              "stories": [
                "sql"
              ]
            },
            {
              "name": "preserve-number-literals",
              "text": "# When no arithmetic is involved jq should preserve the literal value",
              "stories": [
                "lexer",
                "conversion",
                "operators",
                "numeric"
              ]
            },
            {
              "name": "convert-arithmetic-to-double",
              "text": "# Applying arithmetic to the value will truncate the result to double",
              "stories": [
                "operators",
                "numeric"
              ]
            },
            {
              "name": "preserve-negation-precision",
              "text": "# Unary negation preserves numerical precision",
              "stories": [
                "operators",
                "numeric"
              ]
            },
            {
              "name": "use-keyword-bindings",
              "text": "# Using a keyword as variable/label name",
              "stories": [
                "lexer",
                "parser",
                "bindings",
                "loops"
              ]
            },
            {
              "name": "parse-nan",
              "text": "# nan is parsed as a valid NaN value from JSON",
              "stories": [
                "conversion",
                "numeric"
              ]
            },
            {
              "name": "reject-nan-payload",
              "text": "# NaN with payload is not parsed",
              "stories": [
                "conversion"
              ]
            },
            {
              "name": "call-input-and-debug",
              "text": "# calling input/0, or debug/0 in a test doesn't crash jq",
              "stories": [
                "io"
              ]
            },
            {
              "name": "limit-catch-scope",
              "text": "# try/catch catches more than it should #1859",
              "stories": [
                "control"
              ]
            },
            {
              "name": "implode-codepoints",
              "text": "# explode/implode\n# test replacement character (65533) for outside codepoint range and 0xd800 (55296) - 0xdfff (57343) utf16 surrogate pair range\n# 1.1 and 1.9 to test round down of non-ints",
              "stories": [
                "strings"
              ]
            },
            {
              "name": "walk-values",
              "text": "walk(.)\n{\"x\":0}\n{\"x\":0}\n\nwalk(1)\n{\"x\":0}\n1",
              "stories": [
                "traversal"
              ]
            },
            {
              "name": "reject-invalid-trim-inputs",
              "text": "# ltrimstr/1 and rtrimstr/1 return an error for non-strings. #2969",
              "stories": [
                "strings"
              ]
            },
            {
              "name": "limit-json-depth",
              "text": "# regression tests for #3413\n# upper range bounds should be in sync with the constants defined at\n#   src/jv_parse.c:#define MAX_PARSING_DEPTH (N)\n#   src/jv_print.c:#define MAX_PRINT_DEPTH (N)",
              "stories": [
                "conversion"
              ]
            },
            {
              "name": "limit-path-depth",
              "text": "try setpath([range(10001) | 0]; 0) catch .\nnull\n\"Path too deep\"\n\ngetpath([range(10000) | 0])\nnull\nnull\n\ntry getpath([range(10001) | 0]) catch .\nnull\n\"Path too deep\"\n\ndelpaths([[range(10000) | 0]])\nnull\nnull\n\ntry delpaths([[range(10001) | 0]]) catch .\nnull\n\"Path too deep\"",
              "stories": [
                "paths",
                "assignment"
              ]
            },
            {
              "name": "limit-containment-depth",
              "text": "try (reduce range(10001) as $_ ([]; [.]) as $x | $x | contains($x)) catch .\nnull\n\"Containment check too deep\"",
              "stories": [
                "collection-builtins"
              ]
            },
            {
              "name": "limit-object-merge-depth",
              "text": "try (reduce range(10001) as $_ ({}; {a: .}) as $x | $x * $x) catch .\nnull\n\"Object merge too deep\"",
              "stories": [
                "operators"
              ]
            },
            {
              "name": "limit-equality-depth",
              "text": "# regression test for deep structural equality recursion\ntry ((reduce range(10001) as $_ ([]; [.])) as $x | (reduce range(10001) as $_ ([]; [.])) as $y | $x == $y) catch .\nnull\n\"Equality check too deep\"",
              "stories": [
                "operators"
              ]
            },
            {
              "name": "limit-ordering-depth",
              "text": "# regression tests for deep ordering comparisons\ntry ((reduce range(10001) as $_ ([]; [.])) as $x | [$x, $x] | sort) catch .\nnull\n\"Comparison too deep\"",
              "stories": [
                "collection-builtins",
                "operators"
              ]
            }
          ]
        }
      ]
    },
    "lexer.l": {
      "state": "current",
      "versions": [
        {
          "commit": "fa3e338",
          "date": "2026-10-28",
          "hash": "cfb3af17a786df30d7e30dae5861b84747d4904f8ce7ae9ab9b48bde342ee7f3",
          "release": "",
          "state": "consumed",
          "via": "plan",
          "ticket": null,
          "requirements": [
            {
              "name": "track-token-locations",
              "text": "#define YY_USER_ACTION                           \\\n  do {                                           \\\n    yylloc->start = yyget_extra(yyscanner);      \\\n    yylloc->end = yylloc->start + yyleng;        \\\n    yyset_extra(yylloc->end, yyscanner);         \\\n  } while (0);",
              "stories": [
                "lexer"
              ]
            },
            {
              "name": "skip-comments",
              "text": "\"#\" { yy_push_state(IN_COMMENT, yyscanner); }\n<IN_COMMENT>{\n  \\\\(\\\\|\\r?\\n)|. { }\n  \\r?\\n { yy_pop_state(yyscanner); }\n}\n<IN_COMMENT><<EOF>> { yy_pop_state(yyscanner); }",
              "stories": [
                "lexer"
              ]
            },
            {
              "name": "tokenize-keywords-and-operators",
              "text": "\"!=\" { return NEQ; }\n\"==\" { return EQ; }\n\"as\" { return AS; }\n\"import\" { return IMPORT; }\n\"include\" { return INCLUDE; }\n\"module\" { return MODULE; }\n\"def\" { return DEF; }\n\"if\" { return IF; }\n\"then\" { return THEN; }\n\"else\" { return ELSE; }\n\"elif\" { return ELSE_IF; }\n\"and\" { return AND; }\n\"or\" { return OR; }\n\"end\" { return END; }\n\"reduce\" { return REDUCE; }\n\"foreach\" { return FOREACH; }\n\"//\" { return DEFINEDOR; }\n\"try\" { return TRY; }\n\"catch\" { return CATCH; }\n\"label\" { return LABEL; }\n\"break\" { return BREAK; }\n\"$__loc__\" { return LOC; }\n\"|=\" { return SETPIPE; }\n\"+=\" { return SETPLUS; }\n\"-=\" { return SETMINUS; }\n\"*=\" { return SETMULT; }\n\"/=\" { return SETDIV; }\n\"%=\" { return SETMOD; }\n\"//=\" { return SETDEFINEDOR; }\n\"<=\" { return LESSEQ; }\n\">=\" { return GREATEREQ; }\n\"..\" { return REC; }\n\"?//\" { return ALTERNATION; }\n\".\"|\"?\"|\"=\"|\";\"|\",\"|\":\"|\"|\"|\"+\"|\"-\"|\"*\"|\"/\"|\"%\"|\"\\$\"|\"<\"|\">\" { return yytext[0];}",
              "stories": [
                "lexer"
              ]
            },
            {
              "name": "match-delimiters",
              "text": "\"[\"|\"{\"|\"(\" {\n  return enter(yytext[0], YY_START, yyscanner);\n}\n\n\"]\"|\"}\"|\")\" {\n  return try_exit(yytext[0], YY_START, yyscanner);\n}",
              "stories": [
                "lexer"
              ]
            },
            {
              "name": "tokenize-format-names",
              "text": "\"@\"[a-zA-Z0-9_]+ {\n  yylval->literal = jv_string_sized(yytext + 1, yyleng - 1); return FORMAT;\n}",
              "stories": [
                "lexer"
              ]
            },
            {
              "name": "tokenize-numbers",
              "text": "([0-9]+(\\.[0-9]*)?|\\.[0-9]+)([eE][+-]?[0-9]+)? {\n   yylval->literal = jv_parse_sized(yytext, yyleng); return LITERAL;\n}",
              "stories": [
                "lexer"
              ]
            },
            {
              "name": "tokenize-strings-and-interpolation",
              "text": "\"\\\"\" {\n  yy_push_state(IN_QQSTRING, yyscanner);\n  return QQSTRING_START;\n}\n\n<IN_QQSTRING>{\n  \"\\\\(\" {\n    return enter(QQSTRING_INTERP_START, YY_START, yyscanner);\n  }\n  \"\\\"\" {\n    yy_pop_state(yyscanner);\n    return QQSTRING_END;\n  }\n  (\\\\[^u(]|\\\\u[a-zA-Z0-9]{0,4})+ {\n    /* pass escapes to the json parser */\n    jv escapes = jv_string_fmt(\"\\\"%.*s\\\"\", (int)yyleng, yytext);\n    yylval->literal = jv_parse_sized(jv_string_value(escapes), jv_string_length_bytes(jv_copy(escapes)));\n    jv_free(escapes);\n    return QQSTRING_TEXT;\n  }\n  [^\\\\\\\"]+ {\n    yylval->literal = jv_string_sized(yytext, yyleng);\n    return QQSTRING_TEXT;\n  }\n  . {\n    return INVALID_CHARACTER;\n  }\n}",
              "stories": [
                "lexer"
              ]
            },
            {
              "name": "tokenize-identifiers-fields-bindings",
              "text": "([a-zA-Z_][a-zA-Z_0-9]*::)*[a-zA-Z_][a-zA-Z_0-9]*  { yylval->literal = jv_string(yytext); return IDENT;}\n\\.[a-zA-Z_][a-zA-Z_0-9]*  { yylval->literal = jv_string(yytext+1); return FIELD;}\n\\$([a-zA-Z_][a-zA-Z_0-9]*::)*[a-zA-Z_][a-zA-Z_0-9]*  { yylval->literal = jv_string(yytext+1); return BINDING;}",
              "stories": [
                "lexer"
              ]
            },
            {
              "name": "skip-whitespace",
              "text": "[ \\r\\n\\t]+  {}",
              "stories": [
                "lexer"
              ]
            },
            {
              "name": "reject-invalid-characters",
              "text": ". { return INVALID_CHARACTER; }",
              "stories": [
                "lexer"
              ]
            }
          ]
        }
      ]
    },
    "parser.y": {
      "state": "current",
      "versions": [
        {
          "commit": "fa3e338",
          "date": "2026-10-28",
          "hash": "803aa7c0b1acba2228e52d1de392fb51e60a7bbe23e42870aea1d62c43360c60",
          "release": "",
          "state": "consumed",
          "via": "plan",
          "ticket": null,
          "requirements": [
            {
              "name": "resolve-parser-conflicts",
              "text": "/* Instead of raising this, find a way to use precedence to resolve\n * shift-reduce conflicts. */",
              "stories": [
                "parser"
              ]
            },
            {
              "name": "keep-private-variable-syntax-private",
              "text": "/*\n * This `$$$$varname` hack is strictly private to jq builtins.  DO NOT USE!!\n *\n * This is used in `_modify`, in src/builtin.jq, to avoid holding on to a\n * reference to `.`.\n *\n * We could just have the compiler emit bytecode for `_modify` so it can use\n * LOADVN w/o needing jq syntax for LOADVN.\n *\n * This syntax, `$$$$varname`, violates referential transparency: it has\n * side-effects that are surprising.\n *\n * DO NOT USE!!  I will break your jq code if you do use this outside\n * src/builtin.jq.\n */",
              "stories": [
                "parser",
                "bindings",
                "assignment"
              ]
            }
          ]
        }
      ]
    },
    "run_conformance.py": {
      "state": "current",
      "versions": [
        {
          "commit": "fa3e338",
          "date": "2026-10-28",
          "hash": "c1b5be717d542f2d2dc4f4a694dd02ae8c8f84b25f15c6224fbb6a784abe7492",
          "release": "",
          "state": "consumed",
          "via": "plan",
          "ticket": null,
          "requirements": [
            {
              "name": "stage-scoring-instrument",
              "text": "This is the scoring instrument. It is supplied, not authored: it is staged verbatim into the\nbuild directory, hash-verified against the import, and restored before grading. Its exit status\nis the acceptance verdict.",
              "stories": [
                "corpus-staging",
                "terminal-verification"
              ]
            },
            {
              "name": "pass-conformance-corpus",
              "text": "Run the upstream jq conformance corpus against a candidate implementation.",
              "stories": [
                "lexer",
                "parser",
                "core",
                "constructors",
                "operators",
                "control",
                "bindings",
                "paths",
                "assignment",
                "loops",
                "conversion",
                "collection-builtins",
                "strings",
                "formats",
                "numeric",
                "dates",
                "traversal",
                "io",
                "sql",
                "cli",
                "scoped-integration",
                "terminal-verification"
              ]
            },
            {
              "name": "provide-candidate-command",
              "text": "JQ         command that runs the candidate. Required -- this harness is language-neutral\n               and deliberately has no default implementation language.",
              "stories": [
                "cli",
                "documentation"
              ]
            },
            {
              "name": "reject-invalid-programs",
              "text": "``expect_failure`` cases are the corpus's ``%%FAIL`` blocks. Upstream compares their\n    diagnostic text; this runner requires only that the candidate reject the program.",
              "stories": [
                "lexer",
                "parser",
                "cli"
              ]
            },
            {
              "name": "distinguish-error-exits",
              "text": "jq's documented exit codes, which this kit's interface contract adopts. The distinction is\n#: load-bearing: the corpus's %%FAIL cases are programs that must not compile, while an ordinary\n#: case may legitimately raise at run time part-way through its output and still be correct.",
              "stories": [
                "parser",
                "control",
                "cli"
              ]
            },
            {
              "name": "compare-json-values",
              "text": "Structural, not textual: ``1`` and ``1.0`` are the same jq value and the corpus relies on\n    that. Python's ``==`` almost does this, but it also equates ``True`` with ``1`` and\n    ``False`` with ``0``, which jq does not; booleans are therefore matched by identity of type\n    before anything else.",
              "stories": [
                "operators",
                "core"
              ]
            }
          ]
        }
      ]
    }
  }
}
