Run artifact

evidence/prompt_outputs/20261028.150741.384Z_jq_lineage_attribute_codex.output.txt

<requirement name="implement-jq" stories="lexer,parser,core,constructors,operators,control,bindings,paths,assignment,loops,conversion,collection-builtins,strings,formats,numeric,dates,traversal,io,sql">
Build an interpreter for the jq language as described in `sources/jq-manual.txt`.
Correctness is measured by the upstream jq conformance corpus, `sources/jq.test`, taken
verbatim from jq 1.8.2. The goal is to pass every case the corpus supplies, with none
failed and none errored. The suite's size is a property of the pinned corpus; never
assert a case count.
</requirement>
<requirement name="python-implementation" stories="foundation">
The implementation language is Python, fixed by this Target's `TECHNOLOGY_STACK.md` and
governed by `stack/python.md`.
</requirement>
<requirement name="generator-evaluation" stories="core,constructors,operators,control,bindings,loops">
jq is a small language with a large semantic core. Almost every filter is a **generator**:
it takes one input and produces a stream of zero, one, or many outputs, and downstream
filters run once per upstream output. Backtracking through that stream is not an
optimisation, it is the evaluation model, and `reduce`, `foreach`, `limit`, `first`,
`label`/`break`, and the `?//` destructuring alternative are all defined in terms of it.
</requirement>
<requirement name="command-interface" stories="cli,core">
The program is a filter: an executable file named `jq` at the application root, invoked as

```
./jq -c '<program>'
```

with JSON on **stdin**. It writes each value the program produces to **stdout** as one
compact JSON value per line, and exits `0`.
</requirement>
<requirement name="exit-codes" stories="cli,parser,core">
Exit codes follow jq's own, and the distinction is load-bearing because the harness grades
on it:

| Exit | Meaning |
|---|---|
| `0` | the program compiled and ran to completion |
| `3` | the program did not compile — a syntax or static error |
| `5` | the program compiled but raised at run time |

A case may legitimately emit several values and then raise; the harness compares the values
produced before the raise, so exit `5` is not by itself a failure. Exit `3` on a valid
program is always a failure. Diagnostics go to **stderr** and are never compared.
</requirement>
<requirement name="scoped-acceptance" stories="lexer,parser,core,constructors,operators,control,bindings,paths,assignment,loops,conversion,collection-builtins,strings,formats,numeric,dates,traversal,io,sql,cli,scoped-integration">
**Every other story runs its own slice, and the slice executes cases.** Each story's
acceptance invokes `sources/run_conformance.py` with a `--select` expression scoped to the
construct that story implements, supplies `JQ`, and asserts `result.returncode == 0`. Those
are exactly the cases the story's code is supposed to pass, so the run is neither slow nor
red by construction, and the corpus goes green in the order the plan builds it.
</requirement>
<requirement name="stage-source-assets" stories="corpus-staging">
Record this table in the Analysis so every asset is staged onto disk in the build
directory. `sources/jq-manual.txt`, `sources/jq.test`, `sources/parser.y`, and
`sources/lexer.l` are large and must be readable from disk during implementation rather
than carried in prompt text.
</requirement>
<requirement name="validate-corpus-harness" stories="corpus-staging">
`--list` prints the matching cases and runs nothing. Use it while planning, to size and
inspect a selector before committing to it. An acceptance check that invokes it executes
nothing, passes before the story's code exists, and steers no repair; such a check is a
defect. The one exception is the story whose only obligation is that the corpus parses, the
exclusion list applies, and the harness starts — it implements none of the behaviour under
test, so listing is the correct thing for it to assert.
</requirement>
<requirement name="module-grammar-rejection" stories="lexer,parser">
The module *grammar* cases are **not** excluded and must pass. `module (.+1); 0`,
`module []; 0`, `include "a" (.+1); 0`, `include "a" []; 0`, `include "\ "; 0`,
`include "\(a)"; 0`, and `%::wat` are all `%%FAIL` cases: the front end must parse the
module syntax far enough to reject them, without ever touching the filesystem.
</requirement>
<requirement name="numeric-edge-cases" stories="numeric,operators,lexer">
7. **Numbers and edge cases.** `nan`, `infinite`, integer/float equality, large literals,
   and the `have_decnum` builtin — return `false` from it and the corpus takes its
   non-decNumber branch, which native floats satisfy.
</requirement>
<requirement name="terminal-conformance" stories="terminal-verification">
**Exactly one acceptance check runs the whole corpus.** One terminal story — the last one —
runs `sh sources/full_test.sh`, asserts only `result.returncode == 0`, prints the captured
stdout and stderr so a failure can be diagnosed from the evidence, and carries the Sea
Trial. No other acceptance check may run the corpus unscoped, and none may invoke
`full_test.sh` at all.
</requirement>
<requirement name="document-interface" stories="documentation">
- Deliver a concise project `README.md` documenting the stdin/stdout interface, the exit
  codes, and the `sh sources/full_test.sh` command.
</requirement>